[patch] Compile with gcc 4.5.2 (missing enum value)
Brad Hards
bradh at frogmouth.net
Sun May 29 22:41:20 UTC 2011
Hi,
I couldn't compile DHCP release 4.2.1-P1 with a recent gcc. It dies with:
gcc -DHAVE_CONFIG_H -I. -I../includes -g -O2 -Wall -Werror -fno-strict-aliasing -I../bind/include -MT omshell.o -MD -MP -MF .deps/omshell.Tpo -c -o omshell.o omshell.c
cc1: warnings being treated as errors
omshell.c: In function ‘main’:
omshell.c:193:5: error: case value ‘10’ not in enumerated type ‘enum dhcp_token’
omshell.c:197:5: error: case value ‘63’ not in enumerated type ‘enum dhcp_token’
make[1]: *** [omshell.o] Error 1
make[1]: Leaving directory `/home/bradh/dhcp-4.2.1-P1/dhcpctl'
make: *** [all-recursive] Error 1
bradh at nattytest:~$ gcc --version
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
This showed up on the list in January (for 4.1.2), at
https://lists.isc.org/pipermail/dhcp-users/2011-January/012505.html
but I didn't see a response that actually fixes the error.
Here is a trivial patch to address the issue:
--- dhcp-4.2.1-P1-orig/includes/dhctoken.h 2010-02-18 07:33:55.000000000 +1100
+++ dhcp-4.2.1-P1/includes/dhctoken.h 2011-05-30 08:04:09.670800573 +1000
@@ -52,6 +52,8 @@
AMPERSAND = '&',
PIPE = '|',
CARET = '^',
+ QUESTION = '?',
+ LF = '\n', /* aka EOL */
HOST = 256,
FIRST_TOKEN = HOST,
Brad
More information about the dhcp-users
mailing list