[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r15051 - in trunk: build/ac-macros subversion/include subversion/libsvn_ra_dav

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-06-14 22:00:35 CEST

kfogel@collab.net wrote:
> "C. Michael Pilato" <cmpilato@collab.net> writes:
>>kfogel@tigris.org writes:
>>>+#if SVN_NEON_0_25_0
>>
>>I'm not completely sure, but shouldn't this really be #ifdef instead
>>of #if ?
>
> One would think so, but it turns out there's a fallback behavior that
> Does The Right Thing. Your review probably crossed my other mail in
> the pipe; here's what I wrote:
>
>>By the way, the fact that the r15051 conditional compilation guards
>>use "#if" not "#ifdef" should be okay: any macro name remaining
>>after expansion is replaced with 0L by the preprocessor, so if
>>SVN_NEON_0_25_0 isn't defined at all, then all those conditionals
>>should simply evaluate to false.
>
> See also K&R p. 232.

That's all true, but I consider it bad practice to make use of this fallback
behaviour in circumstances where the definition of the variable is under our
control and is therefore known to be of either the defined/undefined kind or
the 1/0 kind at our option. Setting the variable according to one scheme and
testing it according to the other scheme causes unnecessary confusion for
humans, and makes the associated compiler warnings (where available) useless
for detecting real bugs because they have to be turned off or ignored.

Well, that's my three-penn'orth.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 14 22:01:58 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.