[PATCH] #ifdef code cleanup
Andrew Bartlett
abartlet at samba.org
Thu Nov 22 21:06:35 UTC 2018
On Thu, 2018-11-22 at 21:32 +0100, Andreas Schneider wrote:
> On Thursday, 22 November 2018 19:36:57 CET Andrew Bartlett via samba-technical
> wrote:
> > On Thu, 2018-11-22 at 09:30 +0100, Andreas Schneider via samba-
> >
> > technical wrote:
> > > Hi,
> > >
> > > attached is a patchset which cleans up checking for config.h defines
> > > correctly.
> > >
> > > Please review. Push if OK.
> >
> > This looks good, but honestly I'm a bit nervous. Any chance you have
> > done a build somehow forcing -E into the gcc line and compared the
> > results before/after?
>
> This is mostly from CFLAGS="-Wundef"
Sure, it's not the detection method I'm worried about, it is that large
patch sets like this can easily slip in typo or similar and cause the
condition to no longer match.
A way to guard against that is to demonstrate that the build produces
the same output with and without the patch.
When I make big changes to our selftest system I ensure that the same
tests (or if different, I can account for the difference) still get
printed in the output stream, to ensure we don't silently miss tests.
Likewise I'm pretty sure I did checking of the config.h results during
the waf upgrade.
Perhaps build with eg CC="my-cc.sh" that compiles with gcc -E and then
again with a full gcc, to get at the CPP output?
Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list