https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91998
Bug ID: 91998
Summary: Add a __FILE_NAME__ macro
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: fuchedzhy at google dot com
Target Milestone: ---
It would be handy to have macro similar to __FILE__ but expanding to source
*base* file name only.
It might be useful for application logs and asserts, especially on embedded
systems, where we don't want to do string searches in runtime and don't want to
store full paths (which might be very long) in the binary.
Clang added such macro recently, see:
https://reviews.llvm.org/D61756
https://reviews.llvm.org/D17741