Opened 15 years ago

Closed 14 years ago

#5784 closed bug (fixed)

Improvement of some posix headers for gcc2

Reported by: obache Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/alpha1
Keywords: Cc: planche2k@…
Blocked By: Blocking:
Platform: All

Description

Some posix header files need to be fixed for gcc2. Because dummy argument names are conflict with function names. It will be detected with -Wshadow gcc option and with -Wall option, then result in error. It may be a bug of gcc2 because it is just in function declaration statement, so it does really hide nothing. Anyway, attached patch should avoid the issue.

-> cat n.c
#include <string.h>
#include <sys/statvfs.h>
#include <net/if.h>

int main(int argc, char** argv) {
return 0;
}

-> gcc -Werror -Wshadow n.c
cc1: warnings being treated as errors
In file included from /boot/home/n.c:2:
/boot/develop/headers/posix/sys/statvfs.h:35: warning: declaration of `statvfs' shadows global declaration
In file included from /boot/home/n.c:3:
/boot/develop/headers/posix/net/if.h:96: warning: declaration of `index' shadows global declaration

Attachments (1)

header.patch (779 bytes ) - added by obache 15 years ago.

Download all attachments as: .zip

Change History (6)

by obache, 15 years ago

Attachment: header.patch added

comment:1 by andreasf, 15 years ago

Cc: planche2k@… added

comment:2 by mmadia, 14 years ago

patch: 01

comment:3 by scottmc, 14 years ago

Applied in hrev38709. But there's a new one that pops up that should probably also be fixed, let's keep this ticket open until that one is fixed as well.

comment:4 by scottmc, 14 years ago

Here's the new one:

cc1: warnings being treated as errors
In file included from /boot/develop/headers/posix/net/route.h:9,
                 from /boot/develop/headers/posix/net/if.h:9,
                 from /boot/home/n.c:3:
/boot/develop/headers/posix/sys/socket.h:187: warning: declaration of `socket' shadows global declaration

comment:5 by scottmc, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev38711.

Note: See TracTickets for help on using tickets.