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

Jakub Jelinek jakub at redhat.com
Fri Jan 4 11:32:28 UTC 2008


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.

	Jakub




More information about the fedora-devel-list mailing list