Is it possible to tell GCC to compile the source code, and ignore macros like __FILE__
, __LINE__
, etc, etc, or redefine them to expand into let's say - an empty string?
As with any macro you can just use:
#undef __LINE__
#undef __FILE__
and then you can redefine them.
You can also pass -U macroname
to undef a macro name and -D macroname=definition
to define a macro name to the gcc
options.
Note that, as indicated in another answer, undefining or redefining __LINE__
or __FILE__
in C invokes undefined behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With