If gcc is used with optimizations -O2, -O3, or -Os, it will enable optimizations that assume that pointers of different type do not alias, i.e. point to the same address. However, we use this a lot, e.g. in code using libports.
Add -fno-strict-aliasing to CFLAGS to disable optimizations based on the strict aliasing rule. * Makeconf: Add -fno-strict-aliasing to CFLAGS. --- Makeconf | 1 + 1 file changed, 1 insertion(+) diff --git a/Makeconf b/Makeconf index 5cf995d..cb13335 100644 --- a/Makeconf +++ b/Makeconf @@ -80,6 +80,7 @@ CPPFLAGS += $(INCLUDES) \ -D_GNU_SOURCE -D_IO_MTSAFE_IO -D_FILE_OFFSET_BITS=64 \ $($*-CPPFLAGS) CFLAGS += -std=gnu99 $(gnu89-inline-CFLAGS) -Wall -g -O3 \ + -fno-strict-aliasing \ $($*-CFLAGS) # Include the configure-generated file of parameters. -- 1.7.10.4