git: b305e1dfbf69 - stable/11 - aic7xxx: Fix re-building firmware with -fno-common

Jessica Clarke jrtc27 at FreeBSD.org
Fri Jun 4 00:30:18 UTC 2021


The branch stable/11 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=b305e1dfbf695d9082661cdb9cae830cdc592b32

commit b305e1dfbf695d9082661cdb9cae830cdc592b32
Author:     Jessica Clarke <jrtc27 at FreeBSD.org>
AuthorDate: 2021-05-28 18:07:17 +0000
Commit:     Jessica Clarke <jrtc27 at FreeBSD.org>
CommitDate: 2021-06-04 00:30:10 +0000

    aic7xxx: Fix re-building firmware with -fno-common
    
    The generated C output for aicasm_scan.l defines yylineno already, so
    references to it from other files should use an extern declaration.
    
    The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier,
    causing it to both define the struct type and define a variable of that
    struct type, causing any C file including the header to define the same
    variable. This variable is not used (and confusingly clashes with a
    field name just below) and was likely caused by confusion when switching
    between defining fields using similar type macros and defining the type
    itself.
    
    Reviewed by:    imp
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D30525
    
    (cherry picked from commit 5e912f5fec025766521f535d1237330ede7f18e2)
---
 sys/dev/aic7xxx/aicasm/aicasm_gram.y   | 2 +-
 sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
index 87fe1a25bf0a..746eb29d84db 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
@@ -57,7 +57,7 @@
 #include "aicasm_symbol.h"
 #include "aicasm_insformat.h"
 
-int yylineno;
+extern int yylineno;
 char *yyfilename;
 char stock_prefix[] = "aic_";
 char *prefix = stock_prefix;
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h
index 3242152c943b..ec88d494cb6f 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h
+++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h
@@ -108,7 +108,7 @@ struct macro_arg {
 	regex_t	arg_regex;
 	char   *replacement_text;
 };
-STAILQ_HEAD(macro_arg_list, macro_arg) args;
+STAILQ_HEAD(macro_arg_list, macro_arg);
 
 struct macro_info {
 	struct macro_arg_list args;


More information about the dev-commits-src-all mailing list