FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 04-03-2011, 08:46 AM
Sebastian Nowicki
 
Default gnu89-inline

On Sun, Apr 3, 2011 at 4:12 PM, Xavier Chantry <chantry.xavier@gmail.com>wrote:

> On Sun, Apr 3, 2011 at 10:04 AM, Xavier Chantry
> <chantry.xavier@gmail.com> wrote:
> > On Sun, Apr 3, 2011 at 6:55 AM, Sebastian Nowicki <sebnow@gmail.com>
> wrote:
> >> Looks like there are more warnings when using gnu89:
> >>
> >> $ make 2>&1 | grep 'warning:' | cut -d' ' -f3- | sort | uniq -c
> >> 74 comma at end of enumerator list
> >> 1 initializer element is not computable at load time
> >> 7 ISO C90 does not support the 'j' gnu_printf length modifier
> >> 106 ISO C90 does not support the 'z' gnu_printf length modifier
> >> 41 ISO C90 forbids mixed declarations and code
> >> 57 ISO C90 forbids specifying subobject to initialize
> >>
> >>
> >
> > There are lots of duplicates (173 -> 58 warnings after removing them).
> > 4 commas at the end of enumerator lists are a C99-specific
> > feature [-pedantic]
> > 2 extension used [-pedantic]
> > 50 ISO C90 forbids mixing declarations and code
> > [-Wdeclaration-after-statement]
> > 2 variable declaration in for loop is a C99-specific feature
> [-pedantic]
> >
>
> Actually that was the clang result while Seb posted results with gcc.
> In that case, removing duplicates goes from 286 to 214 (mostly comma
> at end of enumerator list from alpm.h)
>
> grep warning make-gcc.log | sort -u | cut -d' ' -f3- | sort | uniq -c
> 4 comma at end of enumerator list
> 1 initializer element is not computable at load time
> 6 ISO C90 does not support the 'j' gnu_printf length modifier
> 105 ISO C90 does not support the 'z' gnu_printf length modifier
> 41 ISO C90 forbids mixed declarations and code
> 57 ISO C90 forbids specifying subobject to initialize
>
>
Any reason not to move to C99? I believe the 'j' and 'z' length modifiers
are standard in C99, along with mixed declarations and probably commas at
the end of enums. The code doesn't conform to C90 atm anyway. Not exactly
compelling arguments, but it would be good to explicitly define which
standard the code base should conform to.
 
Old 04-05-2011, 12:11 AM
Dan McGee
 
Default gnu89-inline

On Sun, Apr 3, 2011 at 3:46 AM, Sebastian Nowicki <sebnow@gmail.com> wrote:
> On Sun, Apr 3, 2011 at 4:12 PM, Xavier Chantry <chantry.xavier@gmail.com>wrote:
>
>> On Sun, Apr 3, 2011 at 10:04 AM, Xavier Chantry
>> <chantry.xavier@gmail.com> wrote:
>> > On Sun, Apr 3, 2011 at 6:55 AM, Sebastian Nowicki <sebnow@gmail.com>
>> wrote:
>> >> Looks like there are more warnings when using gnu89:
>> >>
>> >> $ make 2>&1 | grep 'warning:' | cut -d' ' -f3- | sort | uniq -c
>> >> * * 74 comma at end of enumerator list
>> >> * * *1 initializer element is not computable at load time
>> >> * * *7 ISO C90 does not support the 'j' gnu_printf length modifier
>> >> * *106 ISO C90 does not support the 'z' gnu_printf length modifier
>> >> * * 41 ISO C90 forbids mixed declarations and code
>> >> * * 57 ISO C90 forbids specifying subobject to initialize
>> >>
>> >>
>> >
>> > There are lots of duplicates (173 -> 58 warnings after removing them).
>> > * * *4 commas at the end of enumerator lists are a C99-specific
>> > feature [-pedantic]
>> > * * *2 extension used [-pedantic]
>> > * * 50 ISO C90 forbids mixing declarations and code
>> > [-Wdeclaration-after-statement]
>> > * * *2 variable declaration in for loop is a C99-specific feature
>> [-pedantic]
>> >
>>
>> Actually that was the clang result while Seb posted results with gcc.
>> In that case, removing duplicates goes from 286 to 214 (mostly comma
>> at end of enumerator list from alpm.h)
>>
>> grep warning make-gcc.log | sort -u | cut -d' ' -f3- | sort | uniq -c
>> * * * 4 comma at end of enumerator list
>> * * *1 initializer element is not computable at load time
>> * * *6 ISO C90 does not support the 'j' gnu_printf length modifier
>> * * 105 ISO C90 does not support the 'z' gnu_printf length modifier
>> * * *41 ISO C90 forbids mixed declarations and code
>> * * 57 ISO C90 forbids specifying subobject to initialize
>>
>>
> Any reason not to move to C99? I believe the 'j' and 'z' length modifiers
> are standard in C99, along with mixed declarations and probably commas at
> the end of enums. The code doesn't conform to C90 atm anyway. Not exactly
> compelling arguments, but it would be good to explicitly define which
> standard the code base should conform to.

We're already using C99, so this would be nothing new. Note how
configure.ac asks for a C99 compiler specifically- AC_PROG_CC_C99.

The only thing that I see as potentially worth it out of this is
making alpm.h and alpm_list.h C89 compliant, if we even do that.

-Dan
 

Thread Tools




All times are GMT. The time now is 08:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org