|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [xen-4.0-testing test] 7147: regressions - FAIL
On Sat, 2011-05-21 at 23:19 +0100, Keir Fraser wrote:
> Related to the -Wno-unused-but-set-variable patch. But this is weird because
> the compiler runs many times with this option quite happily, before failing
> on it as an unrecognised option much later in the build (building qemu in
> this case, or stubdom in the case of xen-unstable). Any ideas?
Weirdly it seems like the
unrecognized command line option "-Wno-unused-but-set-variable"
only shows up if the compiler has also generated a warning of some sort.
Since much of the xen tree is built with -Werror it is generally warning
free and so succeeds, but the stbudom and ioemu builds do not use Werror
and sodo have some warnings...
I noticed this because I made a change to hvmloader which caused a
warning, followed by this error. Having fixed the warning it now
succeeds.
It seems like gcc (at least in Debian Squeeze) does some sort of lazy
evaluation of -W options, which seems terribly unlikely but does seem to
be reality. Try compiling the following always with
-Wno-unused-but-set-variable but with and without -DHACK to see what I
mean:
$ gcc -Wno-unused-but-set-variable -DHACK ~/t.c
/home/ianc/t.c: In function 'main':
/home/ianc/t.c:6: warning: initialization makes pointer from integer without a
cast
At top level:
cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"
$ gcc -Wno-unused-but-set-variable ~/t.c
$ cat ~/t.c
#include <stdio.h>
int main(void)
{
#ifdef HACK
void *p = 0x1234;
#else
void *p = NULL;
#endif
printf("P is %p\n", p);
}
Funky.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|