[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: r18448 - trunk/subversion/include

From: Wayne J <wayne_at_zk.com>
Date: 2006-02-14 19:31:51 CET

>[julianfoad@tigris.org]
>> Fix a C'89 incompatibility.
>>
>> * subversion/include/svn_io.h
>> (svn_io_file_del_t): Remove a trailing comma.
>
>Truly I learn something new every day.
>
>Sure enough, 'gcc -pedantic' warns about trailing commas in enum
>declarations, but *not* about trailing commas when populating an array
>or a struct. I wonder whose bright idea it was to consider the one
>less valid than the others.

I don't believe it's an issue of correctness but rather practicality.
Allowing a comma on the end of an array initialization makes it easier
to write code that generates and array initialization as you don't have
to special case the last element:

puts("int my_array[] = {");
for(i=0;i < n; i ++)
    printf("%d,", i);
puts("};\n");

...

My guess is that at the time this was evolving programmatically
generating enums was not popular ...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 14 19:32:18 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.