Meaning of __BASE_FILE__ inside -include file?
Gary Funck
gary@intrepid.com
Wed Oct 13 22:45:00 GMT 2004
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?
More information about the Gcc
mailing list