From kde-commits Sun Aug 31 22:45:36 2003 From: Scott Wheeler Date: Sun, 31 Aug 2003 22:45:36 +0000 To: kde-commits Subject: Re: kdepim/kitchensync/kitchensync/lib X-MARC-Message: https://marc.info/?l=kde-commits&m=106237005023667 -----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-----