On Fri, 01 May 2009 08:57:34 PDT "Matthew Fleming" <matthew.flem...@isilon.com> 
 wrote:
> [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).

Why would you put initializers in a header file? If included
in more than one file, the linker will complain that the
initialized variable is multiply defined.  If creating header
files that get included in in only one file *and* you want to
use initializers, why not use the right language for include
file code.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to