Runtime code vs compile time conditional compilation

Florian Schanda ma1flfs at bath.ac.uk
Mon Feb 16 03:39:21 CST 2004


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

On Sunday 15 February 2004 21:11, Alexandre Julliard wrote:
> > The compiler warning attracted my attention to code that if believe
> > would be better as a #if.
>
> No, using normal code is always better than #ifdefs. This way all the
> code gets compiled and checked for errors, plus you don't need to
> write autoconf magic for things that the compiler can do itself.

And a half-decent compiler will figure out that those checks are constant 
anyway and optimize the dead code away.

(But then there's allways the issue of trusting your compiler to do the job 
right...)

	Florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAMI/MfCf8muQVS4cRAt4DAKCm4GNetUxY5WkKqNQ8UHPQSyI7oACaA8hU
EnS8s5jG0UmAifJwWC+Ocy4=
=1F3U
-----END PGP SIGNATURE-----




More information about the wine-devel mailing list