The defs.h / common-defs.h / server.h rule

Simon Marchi simon.marchi@polymtl.ca
Fri Feb 23 21:55:10 GMT 2024



On 2024-02-23 16:06, Tom Tromey wrote:
> Simon> I suppose the other classic way to do this is with an -include flag,
> Simon> passed to the compiler?
> 
> I don't know if any projects do this, but traditionally it's not done by
> GNU-ish programs, I guess because -include was GCC-specific, i.e., not
> portable.

Do you think it would be acceptable today?  As far as I know, people
only build gdb with gcc and clang.  But I checked other compilers I
know:

 - icc has -include (it uses the clang frontend now, I think)
 - xlc has -qinclude (although it seems like there's a version with a
   clang frontend as well which supports -include too)

So, in this day and age, I'd be surprised if anyone compiled gdb with a
compiler that doesn't have some equivalent of -include.

Simon


More information about the Gdb-patches mailing list