macro feature tests in rsync code
wayned at samba.org
Sun Feb 13 06:31:14 GMT 2005
On Sat, Feb 12, 2005 at 09:53:28PM -0500, John E. Malmberg wrote:
> The tests in rsync for features have been changed to testing the value
> of a macro definition instead of previously testing if the macro was
Acutally, the various tests were sometimes inconsistent -- some were
testing if a config item was defined, and some testing if it was
non-zero. I made them all consistent in their checking for a non-zero
> This testing is now inconsistent with the HAVE_SOCKETPAIR macro, where
> in some places it is tested to see if the macro is defined, and other
> places to if it has a non zero value.
I don't see this. All the code in CVS uses "#if" to test the value of
> I would rather not globally disable the diagnostic about undefined
> macros, as it has shown in the past to help find programming problems.
I assume you're talking about gcc's -Wundef option. We could add
-Wno-undef to the gcc CFLAGS setting in configure.in, like this:
# If GCC, turn on warnings.
if test x"$GCC" = x"yes"
CFLAGS="$CFLAGS -Wall -W -Wno-undef"
That would add the flag to the Makefile and should silence any warnings
More information about the rsync