[PATCH][1/1] - Xserver - XTrap prep sources for config.h inclusion

GOMBAS Gabor gombasg at sztaki.hu
Tue Apr 19 03:55:17 PDT 2005


On Tue, Apr 19, 2005 at 05:57:59PM +1000, Daniel Stone wrote:

> Depends if they're internal or external headers.  But even if they're
> external, it'd be unlikely to do any harm.  That being said, it's not
> the best of ideas that you should do it unless you need to.

#including <config.h> from external headers _is_ extremely harmful:

1. All projects that do not use autoconf will break if they try to use
   that header file
2. Even if config.h is provided by the project wanting to include the
   header, it's contents will be completely different from what the
   header expects (even the _meaning_ of the very same macro being
   defined/undefined might be different)

Please do not include <config.h> from any external header. In fact, the
best practice is not to include <config.h> from _any_ header at all,
include it only from source (.c, .cpp etc.) files.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------


More information about the xorg-modular mailing list