This is the mail archive of the gcc-patches@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: Push GENERIC farther into C/C++ front ends.


Tom Tromey wrote:

It seems that the idea of having a C program also compilable by a C++
compiler comes up quite a bit.  I wonder if it would make sense to
enable the C compiler to warn about the use of C++ keywords.

Maybe so.


The things that seem to get more often broken (in my experience) are things like the different rules about pointer conversions and the fact that prototypes are required in C++. (The latter is something that we should already be catching with warnings in GCC.) The conversions between enumerations constants and integers (or lack thereof in C++) is another place where people can easily write valid C that isn't valid C++.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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