[Bug preprocessor/82176] Feature request: replace __FILE__ with file's basename instead its full name

fuchedzhy at google dot com gcc-bugzilla@gcc.gnu.org
Tue Oct 29 17:32:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82176

--- Comment #10 from Gregory Fuchedzhy <fuchedzhy at google dot com> ---
(In reply to f.hollerer from comment #8)
> To my understanding assert() uses __FILE__ and __LINE__. I would like to
> have a command line option which let __FILE__ expand to the last path
> component (the filename) instead of an invocation dependent full path of
> that file.

If __FILE_NAME__ is implemented would adding -D__FILE__=__FILE_NAME__ solve
your particular usecase?


More information about the Gcc-bugs mailing list