Bug 3067

Summary: include/sys/mount.h enum final value has unwanted comma
Product: uClibc Reporter: Will Moore <will.moore>
Component: Standard ComplianceAssignee: Carmelo Amoroso <carmelo.amoroso>
Status: RESOLVED INVALID    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: 0.9.31   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Will Moore 2011-01-12 10:01:04 UTC
/include/sys/mount.h line 60 has
  MS_BIND = 4096,		/* Bind directory at different place.  */
when it should be
  MS_BIND = 4096		/* Bind directory at different place.  */

As a final value in an enum gcc coughs at the comma.  Looking at the git tree
online this is still present though I tripped over it when using uclibc 0.9.31
as a part of buildroot2010.11.
Comment 1 Carmelo Amoroso 2011-02-01 10:35:31 UTC
Hi,
which gcc version and which compiler options used to compile ?

Please, could you post your error log ?
Comment 2 Will Moore 2011-02-01 10:53:25 UTC
I am using buildroot-2010.11 built gcc 4.3.5.
I have set gcc -pedantic -pedantic-errors -Wall -Werror for belt and braces.
I believe it is the -pedantic-errors that catches the issue here.
The error reported is:

Building file: ../main.c
Invoking: GCC C Compiler
i486-linux-gcc -I/home/apmdev/dx/buildroot-2010.11/output/staging/usr/include -O0 -g3 -pedantic -pedantic-errors -Wall -Werror -c -fmessage-length=0 -Wno-long-long -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.c"
In file included from ../main.c:11:
/home/apmdev/dx/buildroot-2010.11/output/staging/usr/include/sys/mount.h:60: error: comma at end of enumerator list
make: *** [main.o] Error 1
Comment 3 Bernhard Reutner-Fischer 2011-05-02 08:38:07 UTC
(In reply to comment #2)
> I am using buildroot-2010.11 built gcc 4.3.5.
> I have set gcc -pedantic -pedantic-errors -Wall -Werror for belt and braces.
> I believe it is the -pedantic-errors that catches the issue here.

First 4.3.x is inadequate with these flags, if anything then use 4.6.0 or 4.5.3 (at the time of this writing) with -Wall and, if you are masochistic, -Werror.
Second that flags are not sane, just don't do that ;)
Comment 4 Will Moore 2011-05-03 08:48:59 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I am using buildroot-2010.11 built gcc 4.3.5.
> > I have set gcc -pedantic -pedantic-errors -Wall -Werror for belt and braces.
> > I believe it is the -pedantic-errors that catches the issue here.
> First 4.3.x is inadequate with these flags, if anything then use 4.6.0 or 4.5.3

I don't understand what you mean by inadequate.  The gcc 4.3.5 user manual describes these options, gcc 4.3.5 seems to work with these options.

> (at the time of this writing) with -Wall and, if you are masochistic, -Werror.
> Second that flags are not sane, just don't do that ;)

I appreciate that you might not recommend these flags ;) but they are valid, if restrictive, and a legitimate way of using gcc, are they not?