the same gcc binary emits warnings on one machine but not on another

Jonathan Wakely jwakely.gcc@gmail.com
Thu Oct 20 17:53:00 GMT 2016


On 20 October 2016 at 18:42, john smith wrote:
> We use the same cross-compiler on two Linux machines: machine A and
> machine B.  It produces some warnings on machine A but not on machine
> B when used to compile the same file and with the same set of options
> (specifically we use -Wall and -Wextra).  We are absolutely sure that
> it's the same compiler - it's in the same version and has the same
> md5sum on both machines.  However, these 2 Linux machines differ - A
> is x32 Ubuntu, B is x64 bit Slackware.  I checked all environment

Do you really mean x32, as in https://en.wikipedia.org/wiki/X32_ABI ?
Or do you mean you mean x86 aka IA-32?

Are both compilers producing 32-bit output? Both producing 64-bit
output? One 32-bit and one 64-bit?

That could make all the difference, compiling printf("%lu",
sizeof(1)); will warn for i686 and not for x86_64, for example.


> variables on both machines and didn't find anything suspicious - no
> CFLAGS, CC or something related to compilation at all.  The compiler
> in question behaves the same way when invoked from Makefile and when
> invoked directly from the command line on both machines.
>
> Is this possible that due to some local differences in
> libc/libgcc/whatnot GCC emits warnings on machine A but not on machine
> B?

Yes. Of course. If a header in /usr/include has a #warning in it on
one machine and not in the other it's going to warn on one machine and
not on the other. That's a silly example, but t here are loads of
things that could cause it.

>  What else can I check to learn what's the culprit here?

All you've said is "I checked everything" and not told us anything useful.

What's the warning? What does the code look like that triggers it?



More information about the Gcc-help mailing list