Feature request: replace __FILE__ with file's basename instead its full name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
Actually, this is a feature request, not a bug report.
It would be great to have a command line option to tell the preprocessor to replace __FILE__ with the basename of a file, not the complete name with relative or absolute path components as passed to the preprocessor / compiler when invoked.
Reason is to minimise the amount of FLASH / code memory required for the strings.
Explanation:
I am using arm-none-eabi-gcc version 6.3.1 downloaded from https:/
I don't want to turn off assert()s completely, but with __FILE__ being replaced with the full file name blows up my firmware image. Restricting it to the file's basename would bring the image back to reasonable size, by still providing good error messages.
I think this feature would be valuable for other developers too.
Thanks & Best regards,
Franz Hollerer
Hi Franz,
This is a general improvement to GCC (not ARM specific) hence I would suggest you to report it on the project's bugzilla: http:// gcc.gnu. org/bugzilla.
Best regards,
Tom