From owner-freebsd-hackers@FreeBSD.ORG Fri May 1 16:09:13 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9E81065678 for ; Fri, 1 May 2009 16:09:13 +0000 (UTC) (envelope-from matthew.fleming@isilon.com) Received: from seaxch09.isilon.com (seaxch09.isilon.com [74.85.160.25]) by mx1.freebsd.org (Postfix) with ESMTP id 00BC18FC19 for ; Fri, 1 May 2009 16:09:12 +0000 (UTC) (envelope-from matthew.fleming@isilon.com) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 1 May 2009 08:57:34 -0700 Message-ID: <06D5F9F6F655AD4C92E28B662F7F853E02ACA843@seaxch09.desktop.isilon.com> In-Reply-To: <49FAE4EA.1010205@gmx.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: C++ incompatability, was C99: Suggestions for style(9) Thread-Index: AcnKVOrLOASvMCbnRYWtAm5tTqsg4QAH/vtQ References: <49F4070C.2000108@gmx.de><20090428114754.GB89235@server.vk2pj.dyndns.org> <49FAE4EA.1010205@gmx.de> From: "Matthew Fleming" To: "FreeBSD Hackers" Subject: C++ incompatability, was C99: Suggestions for style(9) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2009 16:09:13 -0000 [snip exciting discussion on style] > There are several C99 features used already, e.g. designated initializers: > bla bli =3D { .blub =3D "foo", .arr[0] =3D 42 }; > Do you suggest that this should not be used, because it is inconsistent=20 > 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=20 #ifdef __cplusplus extern "C" { #endif to sys/sys/*.h and other headers that can be included by a kernel module. Thanks, matthew