Google Test requires these CPP FLAGS "-Wno-missing-field-initializers - Wno-variadic-macros" in order to not output warnings. However, these flags are only available with gcc 4.X. We don't want to prevent users from being able to build with gcc 3.X which is the current situation (http://llvm.org/PR3487 ). I've disabled building Google Test in the 2.5 branch. Hopefully someone can fix this issue and we can get it merged into the release branch. Ideally, configure should detect what version of gcc you have and either use those CPP FLAGS or not (it will output warnings with 3.X). Or, we just disable building Google Test by default. Can anyone help with this? Thanks, Tanya -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090204/348df8fc/attachment.html>
On Feb 4, 2009, at 9:10 PM, Tanya Lattner wrote:> Ideally, configure should detect what version of gcc you have and > either use those CPP FLAGS or not (it will output warnings with > 3.X). Or, we just disable building Google Test by default.> Can anyone help with this?Here is a Makefile fragment that will dynamically test gcc and add flags, if the flag is supported. I'll leave it up to others to consider and/or integrate it and consider if /dev/null is portable enough. FLAGS := $(shell gcc -Wall -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wall) CFLAGS := $(shell gcc -Wallme -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wallme) all: @echo flags are $(FLAGS) @echo flags are $(CFLAGS) The down side, these execute every time the fragment is read. If limited to just a few directories, it should be fine, Makefile.common would hurt.
On Feb 4, 2009, at 9:26 PM, Mike Stump wrote:> On Feb 4, 2009, at 9:10 PM, Tanya Lattner wrote: >> Ideally, configure should detect what version of gcc you have and >> either use those CPP FLAGS or not (it will output warnings with >> 3.X). Or, we just disable building Google Test by default. > >> Can anyone help with this? > > Here is a Makefile fragment that will dynamically test gcc and add > flags, if the flag is supported. I'll leave it up to others to > consider and/or integrate it and consider if /dev/null is portable > enough. > > FLAGS := $(shell gcc -Wall -fsyntax-only -xc /dev/null 2>/dev/null && > echo -Wall) > CFLAGS := $(shell gcc -Wallme -fsyntax-only -xc /dev/null 2>/dev/null > && echo -Wallme) > all: > @echo flags are $(FLAGS) > @echo flags are $(CFLAGS) > > The down side, these execute every time the fragment is read. If > limited to just a few directories, it should be fine, Makefile.common > would hurt.Putting it into the one directory (utils/unittest) that needs it should be fine. Can you please test and apply a patch to mainline? Thanks Mike, -Chris