Silence gcc strict aliasing warnings where vtree.h is used

Please relace the vtree.h #pragma change of this commit with a better
solution once you have one.

777e03ba had the disadvantage that it
requires all vmods to adjust their build, besides affecting more code
than necessary.

Under the assumption that the issue with VRBT is not acutally a
violation of strict aliasing, but rather only a violation of gcc's
pedantic "compatible lvalue rule", we silence gcc warnings rather than
turning off strict aliasing.

Note that this is more convenient, but also more dangerous, because we
fail to catch any actual strict aliasing errors where vtree.h is used.

This reverts commit 777e03ba.
parent 2cf57b2e
......@@ -159,7 +159,6 @@ nobase_pkginclude_HEADERS = \
vcldir=$(datarootdir)/$(PACKAGE)/vcl
varnishd_CFLAGS = \
@vtree_extra_cflags@ \
@PCRE_CFLAGS@ \
@SAN_CFLAGS@ \
-DNOT_IN_A_VMOD \
......
......@@ -13,7 +13,6 @@ varnishtop_SOURCES = \
varnishtop_CFLAGS = \
@vtree_extra_cflags@ \
@SAN_CFLAGS@
varnishtop_LDADD = \
......
......@@ -291,8 +291,6 @@ CFLAGS="${save_CFLAGS}"
if test "x$GCC" = "xyes"; then
libvgz_extra_cflags="${libvgz_extra_cflags} -Wno-unknown-warning-option -Wno-implicit-fallthrough"
AC_SUBST(libvgz_extra_cflags)
vtree_extra_cflags="-fno-strict-aliasing"
AC_SUBST(vtree_extra_cflags)
fi
SAN_CFLAGS=
......
......@@ -32,6 +32,10 @@
#ifndef _VTREE_H_
#define _VTREE_H_
/* XXX
* Enable -Wall with gcc -O2
*/
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
/*
* This file defines data structures for different types of trees:
......@@ -832,5 +836,4 @@ name##_VRBT_REINSERT(struct name *head, struct type *elm) \
for ((x) = VRBT_MAX(name, head); \
((x) != NULL) && ((y) = name##_VRBT_PREV(x), (x) != NULL); \
(x) = (y))
#endif /* _VTREE_H_ */
......@@ -37,7 +37,6 @@ endif
libvarnishapi_la_CFLAGS = \
-DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' \
@vtree_extra_cflags@ \
@SAN_CFLAGS@
libvarnishapi_la_LIBADD = \
......
......@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
noinst_LIBRARIES = libvcc.a
libvcc_a_CFLAGS = \
@vtree_extra_cflags@ \
@SAN_CFLAGS@
libvcc_a_SOURCES = \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment