Turn off compiler strict aliasing
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 18 May 2011 23:08:56 +0000 (16:08 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 18 May 2011 23:08:56 +0000 (16:08 -0700)
The code does things like ntohs(*(unsigned short*) b->message_age)
which break strict alias checking in gcc.

Makefile

index 4840a00..7da92b3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@ CTLSOURCES = ctl_main.c ctl_cli_wrap.c ctl_socket_client.c
 CTLOBJECTS = $(CTLSOURCES:.c=.o)
 
 CC=gcc
-CFLAGS = -Wall -Werror -O2 -g -D_REENTRANT -D__LINUX__ -DVERSION=$(version) -DBUILD=$(build) -I. -I./include -I./rstplib
+CFLAGS = -Wall -Werror -fno-strict-aliasing -O2 -g -D_REENTRANT -D__LINUX__ \
+       -DVERSION=$(version) -DBUILD=$(build) -I. -I./include -I./rstplib
 
 all: rstpd rstpctl