C vs C++ compilations

Mark Salter msalter@redhat.com
Wed Oct 15 13:44:00 GMT 2003


>>>>> Gary Thomas writes:

> I'm experimenting with GCC-3.3.  This version is starting to be
> *really* picky about some things.  In particular, the eCos Makefile(s)
> use XX-gcc to compile either C or C++ source files, often with
> some C++ only flags thrown in.  This leads to warnings like this:
>   cc1: warning: "-Woverloaded-virtual" is valid for C++ but not for C/ObjC
>   cc1: warning: "-fno-rtti" is valid for C++ but not for C/ObjC
>   cc1: warning: "-fvtable-gc" is valid for C++ but not for C/ObjC

> I'd like to get rid of these and the best way [I think] would be
> to change the rules so that C files are built using XXX-gcc using
> C flags and C++ files are built using XXX-g++ with C++ flags.  I
> also think that over time, the compiler may decide that this is no
> longer just a warning, but an error, so thinking about this now will
> save us in the future.

The future may be closer than you think. I recently heard some rumors
that -finit-priority will cause an error with bleeding edge gcc. That
flag was removed some years ago when the functionality was made the
default behavior.

--Mark



More information about the Ecos-devel mailing list