mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] aic7xxx/aicasm build failure w/gcc-3.4.6
@ 2007-05-22 11:51 Bob Tracy
  2007-05-22 14:26 ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Tracy @ 2007-05-22 11:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]

Second try: originally reported this back on April 17th.  2.6.X
kernel builds started failing after I upgraded my compiler from
gcc-3.3.X to gcc-3.4.6:

make -C drivers/scsi/aic7xxx/aicasm
(...)
gcc -I/usr/include -I. aicasm.c aicasm_symbol.c aicasm_gram.c aicasm_macro_gram.c aicasm_scan.c aicasm_macro_scan.c -o aicasm -ldb
aicasm_gram.y:1948: error: conflicting types for 'yyerror'
aicasm_gram.tab.c:3004: error: previous implicit declaration of 'yyerror' was here
aicasm_macro_gram.y:162: error: conflicting types for 'mmerror'
aicasm_macro_gram.tab.c:1196: error: previous implicit declaration of 'mmerror' was here

As a workaround, commenting out or deleting the "void" declarations
for yyerror() and mmerror() in the respective ".y" files fixes the
problem.  A patch to illustrate the offending code is attached, but
there's no "signed-off by" line because I'm certain the final form of
the patch will be different.  The patch applies cleanly to at least
2.6.21 and later kernels.  gcc-3.3 may have been warning about the
type conflicts, but I didn't notice: gcc-3.4 treats the type conflicts
as errors, so I *did* notice :-).

Here's the "gcc -v" output:

Reading specs from /usr/lib/gcc/i486-slackware-linux/3.4.6/specs
Configured with: ../gcc-3.4.6/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.4.6

-- 
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org
rct@frus.com
-----------------------------------------------------------------------

[-- Attachment #2: patch22_aicasm --]
[-- Type: text/plain, Size: 626 bytes --]

--- linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y.orig	2006-02-06 06:00:58.000000000 -0600
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y	2007-04-16 12:31:08.000000000 -0500
@@ -1943,7 +1943,7 @@
 	versions[newlen + oldlen + 1] = '\0';
 }
 
-void
+/* void */
 yyerror(const char *string)
 {
 	stop(string, EX_DATAERR);
--- linux/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y.orig	2002-12-24 07:09:30.000000000 -0600
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y	2007-04-16 12:32:48.000000000 -0500
@@ -157,7 +157,7 @@
 	}
 }
 
-void
+/* void */
 mmerror(const char *string)
 {
 	stop(string, EX_DATAERR);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aic7xxx/aicasm build failure w/gcc-3.4.6
  2007-05-22 11:51 [PATCH] aic7xxx/aicasm build failure w/gcc-3.4.6 Bob Tracy
@ 2007-05-22 14:26 ` James Bottomley
  2007-05-22 15:11   ` Bob Tracy
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2007-05-22 14:26 UTC (permalink / raw)
  To: Bob Tracy; +Cc: linux-kernel, linux-scsi

On Tue, 2007-05-22 at 06:51 -0500, Bob Tracy wrote:
> Second try: originally reported this back on April 17th.  2.6.X
> kernel builds started failing after I upgraded my compiler from
> gcc-3.3.X to gcc-3.4.6:
> 
> make -C drivers/scsi/aic7xxx/aicasm
> (...)
> gcc -I/usr/include -I. aicasm.c aicasm_symbol.c aicasm_gram.c aicasm_macro_gram.c aicasm_scan.c aicasm_macro_scan.c -o aicasm -ldb
> aicasm_gram.y:1948: error: conflicting types for 'yyerror'
> aicasm_gram.tab.c:3004: error: previous implicit declaration of 'yyerror' was here
> aicasm_macro_gram.y:162: error: conflicting types for 'mmerror'
> aicasm_macro_gram.tab.c:1196: error: previous implicit declaration of 'mmerror' was here
> 
> As a workaround, commenting out or deleting the "void" declarations
> for yyerror() and mmerror() in the respective ".y" files fixes the
> problem.

We really don't want gcc making assumptions about prototypes ... even if
it's getting them right in all likelihood (doubtless unprototyped
assumed functions will become a warning and then an error in later gcc
versions ...), so this is a better fix

James

diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
index c328596..6066998 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
@@ -106,6 +106,7 @@ static void make_expression(expression_t *immed, int value);
 static void add_conditional(symbol_t *symbol);
 static void add_version(const char *verstring);
 static int  is_download_const(expression_t *immed);
+void yyerror(const char *string);
 
 #define SRAM_SYMNAME "SRAM_BASE"
 #define SCB_SYMNAME "SCB_BASE"
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
index 439f760..ff46aa6 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
@@ -65,6 +65,7 @@
 static symbol_t *macro_symbol;
 
 static void add_macro_arg(const char *argtext, int position);
+void mmerror(const char *string);
 
 %}
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aic7xxx/aicasm build failure w/gcc-3.4.6
  2007-05-22 14:26 ` James Bottomley
@ 2007-05-22 15:11   ` Bob Tracy
  0 siblings, 0 replies; 3+ messages in thread
From: Bob Tracy @ 2007-05-22 15:11 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-kernel, linux-scsi

James Bottomley wrote:
> We really don't want gcc making assumptions about prototypes ... even if
> it's getting them right in all likelihood (doubtless unprototyped
> assumed functions will become a warning and then an error in later gcc
> versions ...), so this is a better fix

ACK.  The fix works here.  If you would be so kind, please push it
upstream at your convenience.

gcc-4.X violates the principle of least astonishment over even more
nitnoid matters, but that's another flame for another day.

-- 
-----------------------------------------------------------------------
Bob Tracy               | "Eagles may soar, but weasels don't get
rct@frus.com            |  sucked into jet engines."       --Anon
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-22 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-22 11:51 [PATCH] aic7xxx/aicasm build failure w/gcc-3.4.6 Bob Tracy
2007-05-22 14:26 ` James Bottomley
2007-05-22 15:11   ` Bob Tracy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®