Bug 3067 - include/sys/mount.h enum final value has unwanted comma
Summary: include/sys/mount.h enum final value has unwanted comma
Status: RESOLVED INVALID
Alias: None
Product: uClibc
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 0.9.31
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: Carmelo Amoroso
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 10:01 UTC by Will Moore
Modified: 2011-05-03 08:48 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?