[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdepim/kitchensync/kitchensync/lib
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2003-08-31 22:45:36
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 01 September 2003 0:38, Cornelius Schumacher wrote:
> Is there a problem with it being undefined in an #if? It gives a warning 
> and that's exactly was is correct here, because this has to be fixed 
> but it isn't a compilation error.

I'm not sure I know what you're trying for here.  If you want a warning why 
not use #warning (with the appropriate check for GCC)?

#ifdef __GNUC__
#warning foo
#endif

If you want to check the value of a define and you aren't sure that it's 
defined, you can use:


#if defined(foo) && foo
// stuff
#endif

As it currently is it's relying on an undefined side effect of #if with GCC.

I don't know of any compilers that would actually bail out on this, but the 
current use doesn't seem to make much sense.

- -Scott

- -- 
There are 10 types of people in the world: Those who understand binary, and 
those who don't.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/UnqUQu0ByfY5QTkRAqhtAKCOVl6ZMDjFKCDTaHBEoIxGqeD8YgCgjHhb
Nb+2pYz3eKjVI3yBoTaexFQ=
=RryB
-----END PGP SIGNATURE-----

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic