Re: -Wimplicit-function-declaration with C++ warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux