This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Meaning of __BASE_FILE__ inside -include file?


Hello, given the following ident-like definition living inside
a header file:

/* Place configuration information required by the Berkeley
   UPC compilation system into the object file. */
static const char GCCUPCConfig[] __attribute__ ((section("upc_pgm_info"))) =
  "$GCCUPCConfig: (" __BASE_FILE__ ") "
                   __UPC_THREADS_CONFIG__ " " __UPC_THREADS_MODEL__ "$";

When this file is included via an expliict #include in the source program,
it generates the expected result.

However, when this file is (pre-) included via a -include switch
on the command line, __BASE_FILE__ expands as "<command line>"
(without the quotes).

__BASE_FILE__ is defined as follows:

This macro expands to the name of the main input file, in the form of a C
string constant. This is the source file that was specified on the command
line of the preprocessor or C compiler.

-----------

Is it reasonable to assume that __BASE_FILE__ should also produce the
expected result when invoked from a header file included via tha -include
switch?  Are there significant implementation issues involved in supporting
this usage?





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]