NetBSD-Bugs archive

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

port-vax/41316: cannot compile sys/netinet6/ip6_input.c with gcc 4.4.1-prerelease



>Number:         41316
>Category:       port-vax
>Synopsis:       cannot compile sys/netinet6/ip6_input.c with gcc 
>4.4.1-prerelease
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 01 02:55:00 +0000 2009
>Originator:     Kurt Lidl
>Release:        netbsd-5-RC4
>Organization:
>Environment:
cross-compile of netbsd-5-RC4 from solaris for a vax
I noticed the problem compiling for a vax, but it's
a MI kernel file.
>Description:
I whacked up a gcc 4.4.1-prerelease to build the netbsd-vax
tree.  (I've not updated to netbsd-5 release, but will soon.)

Anyway, it complains thusly:

#   compile  GENERIC/ip6_input.o
/nbsd/vax-5/tools/bin/vax--netbsdelf-gcc -fno-pic -ffreestanding 
-fno-zero-initialized-in-bss -g -pipe -O2 -std=gnu99 -fno-strict-aliasing 
-Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith 
-Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wno-unreachable-code -Wno-sign-compare -Wno-pointer-sign 
-Wno-attributes -Werror -D_VAX_INLINE_ -I. -I/nbsd/nbsd-5/sys/../common/include 
-I/nbsd/nbsd-5/sys/arch -I/nbsd/nbsd-5/sys -nostdinc -DLKM -DMAXUSERS=8 
-D_KERNEL -D_KERNEL_OPT 
-I/nbsd/nbsd-5/sys/lib/libkern/../../../common/lib/libc/quad 
-I/nbsd/nbsd-5/sys/lib/libkern/../../../common/lib/libc/string 
-I/nbsd/nbsd-5/sys/lib/libkern/../../../common/lib/libc/arch/vax/string 
-I/nbsd/nbsd-5/sys/dist/ipf -c /nbsd/nbsd-5/sys/netinet6/ip6_input.c
cc1: warnings being treated as errors
/nbsd/nbsd-5/sys/netinet6/ip6_input.c: In function 'ip6_savecontrol':
/nbsd/nbsd-5/sys/netinet6/ip6_input.c:1260: error: suggest parentheses around 
operand of '!' or change '&' to '&&' or '!' to '~'
/nbsd/nbsd-5/sys/netinet6/ip6_input.c:1271: error: suggest parentheses around 
operand of '!' or change '&' to '&&' or '!' to '~'


>How-To-Repeat:
Do the above compile.

>Fix:
My patch gets it to compile, but I'm not sure that it is
the true intent of the code.  Perhaps someone could review
and let me know.

Index: sys/netinet6/ip6_input.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/ip6_input.c,v
retrieving revision 1.122
diff -u -3 -r1.122 ip6_input.c
--- sys/netinet6/ip6_input.c    21 Aug 2008 15:34:10 -0000      1.122
+++ sys/netinet6/ip6_input.c    30 Apr 2009 02:45:48 -0000
@@ -1257,7 +1257,7 @@

                        switch (nxt) {
                        case IPPROTO_DSTOPTS:
-                               if (!in6p->in6p_flags & IN6P_DSTOPTS)
+                               if (!(in6p->in6p_flags & IN6P_DSTOPTS))
                                        break;

                                *mp = sbcreatecontrol((void *)ip6e, elen,
@@ -1268,7 +1268,7 @@
                                break;

                        case IPPROTO_ROUTING:
-                               if (!in6p->in6p_flags & IN6P_RTHDR)
+                               if (!(in6p->in6p_flags & IN6P_RTHDR))
                                        break;

                                *mp = sbcreatecontrol((void *)ip6e, elen,



Home | Main Index | Thread Index | Old Index