https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82176
--- Comment #12 from f.hollerer at gmx dot net --- (In reply to Gregory Fuchedzhy from comment #10) > (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? Yes, but then I also have to add -Wno-builtin-macro-redefined otherwise the compiler will issue a warning. I think best match is the -ffile-prefix-map option jos...@codesourcery.com pointed me to.