This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]