Date: Fri, 1 May 2009 08:57:34 -0700 From: "Matthew Fleming" <matthew.fleming@isilon.com> To: "FreeBSD Hackers" <freebsd-hackers@freebsd.org> Subject: C++ incompatability, was C99: Suggestions for style(9) Message-ID: <06D5F9F6F655AD4C92E28B662F7F853E02ACA843@seaxch09.desktop.isilon.com> In-Reply-To: <49FAE4EA.1010205@gmx.de> References: <49F4070C.2000108@gmx.de><20090428114754.GB89235@server.vk2pj.dyndns.org> <49FAE4EA.1010205@gmx.de>
next in thread | previous in thread | raw e-mail | index | archive | help
[snip exciting discussion on style]
> There are several C99 features used already, e.g. designated
initializers:
> bla bli = { .blub = "foo", .arr[0] = 42 };
> Do you suggest that this should not be used, because it is
inconsistent
> with all the other existing compound initialisations?
Regarding this great feature of C99, sadly, it's not C++ compatible. So
while designated initializers in a C source file are great, in a header
file they will give a compile error if included in e.g. a C++ kernel
module (which otherwise would work fine).
Actually, as a further digression, I was wondering if/when FreeBSD would
add
#ifdef __cplusplus
extern "C" {
#endif
to sys/sys/*.h and other headers that can be included by a kernel
module.
Thanks,
matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06D5F9F6F655AD4C92E28B662F7F853E02ACA843>
