how to leave currently undefined directives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

 `-fdirectives-only' 

handles directives, but not macros. I am looking for the something like the 
opposite: expand macros, and include and defined directives, but leave currently 
undefined directives (and do preprocessing steps prior to handling macros and 
directives).  So that compiling the header foobar.h with -x c-header


/*This is foobar.h*/
#include "incl.h"
#define DEFINED
#if defined DEFINED
#endif



/*This is incl.h*/
#if defined UNDEFINED
#endif


would yield:


# 1 "foobar.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "foobar.h"

# 1 "incl.h" 1

#if defined UNDEFINED
#endif
# 3 "foobar.h" 2


Is there anything like that, or close, or do I have to modify the sources and 
recompile gcc myself?  It seems that it would be a useful option.  What you 
could do with it, is "precompile" each header file, not in the sense currently 
used, but in such a way that you could then for each #include "foobar.h" line in 
a C/C++ source file, include the "precompiled" header instead, and the result of 
the compilation of the C/C++ source would be the same.  

Does this make sense?  

Thank you for any insight,

Mark Galeck


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux