[cairo] [PATCH 6/8] Don't use bare #if on possibly undefined preprocessor symbols

Carl Worth cworth at cworth.org
Wed Jan 17 09:10:12 PST 2007

On Wed, 17 Jan 2007 11:55:30 -0500, Pavel Roskin wrote:
> I was getting warnings about other symbols as well.  I just wanted to
> separate the issues.

Ah, OK. That makes more sense.

> I agree.  More precisely, "#if SYMBOL" should be explicitly allowed and
> should not trigger any warnings.  It has a specific meaning, and the
> other way of achieving the same functionality would be too wordy:

Yes, exactly.

> As for sparse, I'm going to request "#if SYMBOL" to be allowed.  I wrote
> some patches for sparse before, so I hope my voice will be heard.

Sounds great. Josh is a very reasonable guy and very smart. If you
give him a good idea, he'll generally accept it or come back with a
better idea.

> I understand your motives, but users are not supposed to edit config.h
> (they should re-run configure), and if they do, they'd better know the
> rules.

Yeah, yeah, but still... :-)

Anyway, I'd be quite happy with sparse just not complaining about "#if

Oh, and speaking of sparse, would you like to add some Makefile
targets for us so that we can all get some good sparse checking? Maybe
as part of "make check"?

And, I've talked to Josh about it a little bit, but I think there are
big classes of things in cairo that sparse could help out with. For
example, not mixing fixed-point numbers with straight integers---not
mixing user-space values with device-space values etc. If someone
wanted to do the (presumably very little) work to augment sparse to be
able to do things like that, I'd be glad to accept some decorations
throughout the source code to keep sparse happy.

I love compile-time checking---let's fix bugs before the users even
run the code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070117/2701ce12/attachment.pgp

More information about the cairo mailing list