NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/43258: <netdb.h> has redundant redeclaration of 'setservent'



>Number:         43258
>Category:       bin
>Synopsis:       <netdb.h> has redundant redeclaration of 'setservent'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 05 13:20:00 +0000 2010
>Originator:     Hauke Fath
>Release:        NetBSD 5.0_STABLE
>Organization:
        
>Environment:
        
        
System: NetBSD Hochstuhl 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #0: Mon Mar 8 
17:31:46 CET 2010 
hf@Hochstuhl:/var/obj/netbsd-builds/5/i386/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

        /usr/include/netdb.h has a redundant declaration of
        setservent() which breaks builds that fulfill the condition
        '#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0)
        >= 520 || defined(_NETBSD_SOURCE)'.

>How-To-Repeat:

        Try to build bsnmp <http://people.freebsd.org/~harti/bsnmp/>,
        watch it break with

[...]
 cc -c -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wbad-function-cast 
-Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -std=c99 
-Wp,-MD,.deps/snmp.d -DPACKAGE_NAME=\"BSNMP\" -DPACKAGE_TARNAME=\"bsnmp\" 
-DPACKAGE_VERSION=\"1.0\" "-DPACKAGE_STRING=\"BSNMP 1.0\"" 
-DPACKAGE_BUGREPORT=\"harti%freebsd.org@localhost\" -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ERR_H=1 -DHAVE_STRLCPY=1 
-DHAVE_GETADDRINFO=1 -DHAVE_SYS_TREE_H=1 -DHAVE_STDINT_H=1 -DHAVE_INTTYPES_H=1 
-DQUADFMT=PRIu64 -DQUADXFMT=PRIx64 -I. snmp.c  -fPIC -DPIC -o .libs/snmp.o
cc1: warnings being treated as errors
In file included from snmp.c:46:
/usr/include/netdb.h:349: warning: redundant redeclaration of 'setservent'
/usr/include/netdb.h:339: warning: previous declaration of 'setservent' was here

>Fix:
        Apply

Index: netdb.h
===================================================================
RCS file: /cvsroot/src/include/netdb.h,v
retrieving revision 1.63
diff -u -u -r1.63 netdb.h
--- netdb.h     25 Apr 2010 00:54:45 -0000      1.63
+++ netdb.h     5 May 2010 13:09:00 -0000
@@ -339,7 +339,6 @@
 void           setprotoent(int);
 #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
     defined(_NETBSD_SOURCE)
-void           setservent(int);
 int            getaddrinfo(const char * __restrict, const char * __restrict,
                                 const struct addrinfo * __restrict,
                                 struct addrinfo ** __restrict);

        and pull up the change (at least) to netbsd-5.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index