[pacman-dev] gnu89-inline

Sebastian Nowicki sebnow at gmail.com
Sun Apr 3 04:46:31 EDT 2011


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

> On Sun, Apr 3, 2011 at 10:04 AM, Xavier Chantry
> <chantry.xavier at gmail.com> wrote:
> > On Sun, Apr 3, 2011 at 6:55 AM, Sebastian Nowicki <sebnow at 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.


More information about the pacman-dev mailing list