Commit 71fdcc3b authored by Geoff Simmons's avatar Geoff Simmons

Redefine ZERO_OBJ() to use memset().

Newer versions of the compilers have apparently set the source level
switches differently, so that explicit_bzero() is not defined as our
source is currently written. The autoconf AC_CHECK_FUNCS check
evidently sets certain source switches, but is not transparent
about which ones (this has become evident with strdup() as well).

On my machine, right now, defining _DEFAULT_SOURCE appears to do
the trick. But it is not obvious what else that turns on and off.

It is poor practice to cargo-cultishly turn on GNU_SOURCE for
everything. That risks portability and compatibility, and may make
us unwittingly dependent on non-standard features that may or may
not be supported elsewhere.

Besides, we only need ZERO_OBJ() for FREE_OBJ(), it frankly doesn't
matter much if we zero an object whose pointer is about to be free'd.
parent 9ba88698
Pipeline #454 failed with stages
......@@ -41,6 +41,9 @@
#include "vcl.h"
#include "vbm.h"
#undef ZERO_OBJ
#define ZERO_OBJ(to, sz) (void)memset((to), 0, (sz))
#include "vcc_if.h"
/* XXX at least for now, we need the vcc private interface */
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