Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   gnu89-inline (http://www.linux-archive.org/archlinux-pacman-development/509203-gnu89-inline.html)

Sebastian Nowicki 04-03-2011 08:46 AM

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.

Dan McGee 04-05-2011 12:11 AM

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


All times are GMT. The time now is 04:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.