This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -Wimplicit-function-declaration with C++ warnings
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: "EXT-Pennington, Dale K" <dale dot k dot pennington at boeing dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 23 Mar 2009 07:08:02 -0700
- Subject: Re: -Wimplicit-function-declaration with C++ warnings
Hi Dale,
> Due to our existing make setup, I would prefer to not have to make a set
> of flags that is only applicable to C compiles, as that would have a
> cascade effect on our makefiles. Is there a way to have the compiler not
> complain about the flag during C++ compiles, that does not involve
> removing it ?
Alas, no, I don't think so.
Using make -p, I see these builtin productions:
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
COMPILE.cpp = $(COMPILE.cc)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
So it seems to me if you distangle your C, C++ and common C/C++ warning
flags into three separate categories, and add them to make like:
CFLAGS += $(WARN_C) $(WARN_C_CXX)
CXXFLAGS += $(WARN_CXX) $(WARN_C_CXX)
You'd be all set.
HTH,
--Eljay