From: Ian Campbell Subject: Re: [xen-4.0-testing test] 7147: regressions - FAIL Date: Mon, 23 May 2011 13:32:18 +0100 Message-ID: <1306153938.20576.96.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Olaf Hering , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org 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 int main(void) { #ifdef HACK void *p = 0x1234; #else void *p = NULL; #endif printf("P is %p\n", p); } Funky. Ian.