This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[RFA] Build failure following COMMIT: Fix compile time error building i386-netware
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Nick Clifton'" <nickc at redhat dot com>, <binutils at sourceware dot org>
- Date: Mon, 11 Apr 2011 17:01:07 +0200
- Subject: [RFA] Build failure following COMMIT: Fix compile time error building i386-netware
- References: <m38vvhqjh9.fsf@redhat.com>
On cygwin host, I get a build failure due to a warning about possible
use of uninitialized variable adjust in x86_cons.
On that system, lex_got is a macro defined as NULL,
and thus does not set any value to adjust variable.
The patch below fixes that problem
Nick, could you check this in please?
Pierre Muller
GDB pascal language maintainer.
$ cvs diff -u -p config/tc-i386.c
Index: config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.470
diff -u -p -r1.470 tc-i386.c
--- config/tc-i386.c 11 Apr 2011 08:27:46 -0000 1.470
+++ config/tc-i386.c 11 Apr 2011 14:58:21 -0000
@@ -6572,7 +6572,7 @@ x86_cons (expressionS *exp, int size)
/* Handle @GOTOFF and the like in an expression. */
char *save;
char *gotfree_input_line;
- int adjust;
+ int adjust = 0;
save = input_line_pointer;
gotfree_input_line = lex_got (&got_reloc, &adjust, NULL);
> -----Message d'origine-----
> De?: binutils-owner@sourceware.org [mailto:binutils-owner@sourceware.org]
De
> la part de Nick Clifton
> Envoyé?: lundi 11 avril 2011 10:29
> À?: binutils@sourceware.org
> Objet?: COMMIT: Fix compile time error building i386-netware
>
> Hi Guys,
>
> I am checking in the patch below to fix this compile time error
> building the i386-netware toolchain:
>
> gas/config/tc-i386.c: In function 'handle_quad':
> gas/config/tc-i386.c:9180:7: error: implicit declaration of function
> 'x86_cons'
>
> Cheers
> Nick
>
> gas/ChangeLog
> 2011-04-11 Nick Clifton <nickc@redhat.com>
>
> * config/tc-i386.c (x86_cons): Define even for non-ELF targets.
> * config/tc-i386.h (x86_cons): Always prototype.
>
> Index: gas/config/tc-i386.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-i386.c,v
> retrieving revision 1.469
> diff -u -3 -p -r1.469 tc-i386.c
> --- gas/config/tc-i386.c 29 Mar 2011 12:40:50 -0000 1.469
> +++ gas/config/tc-i386.c 11 Apr 2011 08:23:44 -0000
> @@ -6559,6 +6559,7 @@ lex_got (enum bfd_reloc_code_real *rel,
> /* Might be a symbol version string. Don't as_bad here. */
> return NULL;
> }
> +#endif
>
> void
> x86_cons (expressionS *exp, int size)
> @@ -6610,7 +6611,6 @@ x86_cons (expressionS *exp, int size)
> if (intel_syntax)
> i386_intel_simplify (exp);
> }
> -#endif
>
> static void
> signed_cons (int size)
> Index: gas/config/tc-i386.h
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-i386.h,v
> retrieving revision 1.117
> diff -u -3 -p -r1.117 tc-i386.h
> --- gas/config/tc-i386.h 31 Dec 2010 00:33:34 -0000 1.117
> +++ gas/config/tc-i386.h 11 Apr 2011 08:23:44 -0000
> @@ -125,8 +125,8 @@ extern const char *i386_comment_chars;
>
> #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && !defined (LEX_AT)
> #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES)
> -extern void x86_cons (expressionS *, int);
> #endif
> +extern void x86_cons (expressionS *, int);
>
> #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF,
LEN,
> EXP)
> extern void x86_cons_fix_new