[PATCH] #ifdef code cleanup

Andreas Schneider asn at samba.org
Fri Nov 23 14:33:58 UTC 2018


On Friday, 23 November 2018 09:25:23 CET Andrew Bartlett via samba-technical 
wrote:
> On Fri, 2018-11-23 at 10:06 +1300, Andrew Bartlett via samba-technical
> 
> wrote:
> > 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?
> 
> I tried and failed to build that way with the attached.  No idea why it
> doesn't work.  So this isn't a reasonable request.  If someone else can
> eyeball the whole series and check it is correct, I'll be happy.

Here is a list produced with the attach script. I've added comments where they 
are checked, but the check fails so do not show up at all in config.h or we 
have #ifdef in the code and no configure check for it, which means it is dead 
code.



ATTENTION: HAVE_PROCINFO_H not in config.h

-> ctdb/wscript


ATTENTION: HAVE_THREAD_SETSCHED not in config.h

-> ctdb/wscript


ATTENTION: HAVE_IFACE_IFCONF not in config.h

lib/replace/wscript


ATTENTION: HAVE_GSSAPI_GSSAPI_SPNEGO_H not in config.h

define hardcoded in source4/heimdal_build/wscript_configure


ATTENTION: HAVE_SYS_ATTRIBUTES_H not in config.h

lib/replace/wscript


ATTENTION: HAVE_NETGROUP_H not in config.h

lib/replace/wscript


ATTENTION: HAVE_VALGRIND_MEMCHECK_H not in config.h

lib/replace/wscript


ATTENTION: HAVE_STRUCT_TM_TM_ZONE not in config.h

-> missing configure check, only used in modules/getdate.*


ATTENTION: HAVE_TZNAME not in config.h

-> missing configure check, only used in modules/getdate.*


ATTENTION: HAVE_FREEBSD_SUNACL_H not in config.h

source3/wscript


ATTENTION: HAVE_LIBUNWIND_H not in config.h

lib/util/wscript_configure


ATTENTION: HAVE_LIBUNWIND_PTRACE_H not in config.h

Missing configure check, used in source3/utils/smbcontrol.c


ATTENTION: HAVE_SYS_PTRACE_H not in config.h

Missing configure check, used in source3/utils/smbcontrol.c


ATTENTION: HAVE_LINUX_AIO not in config.h

missing configure check, used by source4/ntvfs/posix/pvfs_(read|write).c


ATTENTION: HAVE_ADD_HISTORY not in config.h

missing configure check, used in source4/torture/shell.c and used without a 
#ifdef in libcli/smbreadline/smbreadline.c


Cheers,


	Andreas


-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_config.sh
Type: application/x-shellscript
Size: 180 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20181123/ba6cf427/test_config.bin>


More information about the samba-technical mailing list