On Mon, Aug 30, 2004 at 11:42:28AM -0400, Chris Ross wrote: > > Thanks Dominik. > > One additional minor problem in FScreen.c. Now that you're > always compiling solaris_XineramaQueryScreens(), and later calling > the correct function based on a compiled constant, if you're > building on a Solaris (or likely any non-Xinerama system), > it will complain about the lack of prototype (and conversion > from int to pointer) of the XineramaQueryScreens() call in > FXineramaQueryScreens. > > Is this something we should fix by adding a prototype, > even though we know the function will never be called?
Yes, of course. I'll commit a patch in a minute. > Is it a bug in gcc that it even looks for the prototype, > since really the optimizer should be able to tell that > that's a constant comparison, and it should be able to > simply not call that function ever? The whole idea of not #ifdef'ing code is to have the compiler syntax checks even if a feature is not enabled. The optimizer kicks in only after the syntax checks have been done. This is important to simplify maintenance. We once had around 12 to 14 features that could be switched via configure/ifdef. Just building with all combinations of #define's would have taken days. The new way to handle this is to catch feature tests as early as possible and provide dummy interfaces if the feature is not defined. The optimizer then takes care of removing the useless code. Ciao Dominik ^_^ ^_^ -- Dominik Vogt, [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED]
pgpVsNplFmqEr.pgp
Description: PGP signature