--disable-dhcpv6 not working

Paul Selkirk Paul_Selkirk at isc.org
Tue Feb 10 00:17:42 UTC 2009


Out of curiosity, what version of gcc are you using?  I've reproduced
this behavior on an older version (3.4.6), but it doesn't occur on
newer versions (e.g. 4.3.2).

As to your question ("WHY?"), there's an 'else' section at line 418
of that file, which is conditionalized on DHCPv6.  Without that symbol
defined, the 'else' block is not compiled, and it is theoretically
possible (in the mind of the compiler) that those local variables
(port_local et al) could be used without be initialized.  In actual
fact, this can't happen, and gcc 4.x can somehow figure it out, but
gcc 3.x can't.

The easiest workaround is to edit relay/Makefile, and remove "-Werror"
from CFLAGS.  (This will, of course, revert the next time you run
configure, but I suspect you're not going to have to do that very
often.)

For the longer term solution, I've logged this as a bug, and it will
be addressed in the next release.

-- 
Paul Selkirk
Software Engineer
Internet Systems Consortium, Inc.

> From: Nicholas F Miller <Nicholas.Miller at Colorado.EDU>
> Date: Mon, 9 Feb 2009 08:42:11 -0700
> 
> I am trying to compile DHCP 4.1.0 on a Solaris 9 machine and am having  
> problems when I disable IPv6. If I use:
> 
> ./configure --prefix=/usr/local/dhcp-4.1.0 --localstatedir=/usr/local/ 
> dhcp-4.1.0/etc --disable-dhcpv6
> 
> I get these errors when I run make:
> 
> if gcc -DHAVE_CONFIG_H -I. -I. -I../includes  -DLOCALSTATEDIR='"/usr/ 
> local/dhcp-4.1.0/etc"'   -g -O2 -D_XOPEN_SOURCE - 
> D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__  -Wall -Werror -fno-strict- 
> aliasing -MT dhcrelay.o -MD -MP -MF ".deps/dhcrelay.Tpo" -c -o  
> dhcrelay.o dhcrelay.c; \
> then mv -f ".deps/dhcrelay.Tpo" ".deps/dhcrelay.Po"; else rm -f ".deps/ 
> dhcrelay.Tpo"; exit 1; fi
> cc1: warnings being treated as errors
> dhcrelay.c: In function 'main':
> dhcrelay.c:165: warning: 'port_remote' may be used uninitialized in  
> this function
> dhcrelay.c:165: warning: 'port_local' may be used uninitialized in  
> this function
> dhcrelay.c:164: warning: 'service_remote' may be used uninitialized in  
> this function
> dhcrelay.c:164: warning: 'service_local' may be used uninitialized in  
> this function
> make[1]: *** [dhcrelay.o] Error 1
> 
> If I configure without disabling IPv6 then it compiles fine. WHY?
> ________________________________________________________
> Nicholas Miller, ITS, University of Colorado at Boulder



More information about the dhcp-users mailing list