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

Re: Mass rebuild status with gcc-4.3.0-0.4 of rawhide-20071220



Jakub Jelinek wrote:
On Fri, Jan 04, 2008 at 11:13:46AM +0100, Hans de Goede wrote:
This is bad, as it breaks compatibility with including .c header files, really bad! Tom? Jakub?

C and C++ are different languages, there are many things valid in C and
invalid in C++ and vice versa.  extern "C" is just a linkage thing, doesn't
magically change the source language temporarily to C.

So, if you want to include some header in C++, that header needs to be
includable in C++, i.e. must use the common subset of C and C++.
That includes stuff like not using C++ keywords (new, delete, ...),
adding casts where C++ doesn't allow implicit casting but C does,
and among yet other things for functions without arguments using type fn ();
or type fn (void), but not typedef void something; ... type fn (something);
in prototypes or fn definitions.


Well,

I for one consider this a bug of C++, but I guess arguing about this is useless, so I'll just go and patch alleggl to fix this.

Regards,

Hans


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