[haiku-bugs] [Haiku] #5784: Improvement of some posix headers for gcc2

  • From: "obache" <trac@xxxxxxxxxxxx>
  • Date: Fri, 23 Apr 2010 14:03:56 -0000

#5784: Improvement of some posix headers for gcc2
--------------------------+-------------------------------------------------
 Reporter:  obache        |       Owner:  bonefish 
     Type:  bug           |      Status:  new      
 Priority:  normal        |   Milestone:  R1       
Component:  Build System  |     Version:  R1/alpha1
 Keywords:                |   Blockedby:           
 Platform:  All           |    Blocking:           
--------------------------+-------------------------------------------------
 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
 }}}

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5784>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: