[Pvfs2-developers] state machine compiler tweaks
Rob Ross
rross at mcs.anl.gov
Tue May 30 10:28:24 EDT 2006
Pete Wyckoff wrote:
> walt at clemson.edu wrote on Tue, 30 May 2006 09:28 -0400:
>> Which is more common in compilers:
>>
>> static struct foo foobar = {
>> field1: value1,
>> field4: value4
>> };
>>
>> OR what's shown below:
>>
>> static struct foo foobar = {
>> .field1 = value1,
>> .field4 = value4
>> };
>>
>> The first is used by the kernel code, and has been around for quite a
>> while. I'm not sure what the second form gives us that the first one
>> doesn't. Unless there is a good reason otherwise we should probably
>> stick with the most widely supported.
>
> The first is a gcc-only extension, obsolete since gcc 2.5 according
> to their manual. The latter is part of the ISO C99 spec. If we
> were going to convert from the unnamed version to anything, I'd have
> a strong preference for going with the spec.
Agree.
[snip]
> I think our only problem would be with an old vendor-supplied
> compiler. And my feel is that we should not bother supporting such
> if it reduces our code quality. For the next release, let's leave
> in the few places (dist-*.c, and soon statecomp) where these are
> used and see if anybody complains. It will be easy enough to back
> it out. Other opinions?
I totally agree with your logic and think this is the right thing to do.
Rob
More information about the Pvfs2-developers
mailing list