Hi Mike-- Over on https://bugs.debian.org/811610, you wrote: > [ Unknown signature status ] > Proposing this patch to just disable the warning. Not super familiar > with the general policies around this, though. > > --- > debian/changelog | 7 +++++++ > debian/rules | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/debian/changelog b/debian/changelog > index 9cb8901..535de0c 100644 > --- a/debian/changelog > +++ b/debian/changelog > @@ -1,3 +1,10 @@ > +faketime (0.9.6-4.1) UNRELEASED; urgency=medium > + > + * Non-maintainer upload. > + * Disable the nonnull-compare flag for faketime. > + > + -- Mike Gerow <ge...@mgerow.com> Thu, 07 Jul 2016 11:36:54 +0200 > + > faketime (0.9.6-4) unstable; urgency=medium > > * link to libfaketime's README from faketime's doc dir (thanks, Ximin > diff --git a/debian/rules b/debian/rules > index cf3813a..1cd0399 100755 > --- a/debian/rules > +++ b/debian/rules > @@ -5,6 +5,12 @@ > > export DEB_CFLAGS_MAINT_APPEND=-DMULTI_ARCH > > +# GCC 6 includes a warning for checking if a variable nonnull if it's been > +# tagged that passing a NULL value creates undefined behavior. Ignore this > for > +# faketime since the compilation units that define this for it are in libc, > +# which may or may not have these flags. > +export CFLAGS+=-Wno-nonnull-compare > + > # make sure dh_makeshlibs does not modify post{inst,rm} scripts: > # (avoids lintian's postinst-has-useless-call-to-ldconfig) > override_dh_makeshlibs:
Thanks for this analysis and the proposed fix! I think the issue here is that faketime is providing a wrapper around stat(), and stat itself has undefined behavior if it was passed a NULL pointer. So arguably, in normal code, we would propagate the "undefined behavior" out through faketime's wrapper of stat. However, faketime's wrapper is called through LD_PRELOAD, so no compiler would notice such a marking anyway. So at the moment, i think your conclusion is the right workaround for debian, and i'll upload something like it shortly. However, upstream (Hi Wolfgang on Cc!) might view this differently. Wolfgang, do you want to propose a different way to make faketime build cleanly with GCC 6? --dkg
signature.asc
Description: PGP signature