Comment 3 for bug 1716347

Revision history for this message
Franz Hollerer (f-hollerer) wrote :

> However, this stackoverflow post (https://stackoverflow.com/questions/8487986/file-macro-shows-full-path) claims that it just gives the same result as __FILE__.

I can confirm this claim, at least for

- gcc (Debian 6.3.0-18) 6.3.0 20170516
- arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437]

For both compilers __BASE_FILE__ gives the same result as __FILE__, which is the name of the file as specfied on the command line when invoking the compiler.

Furthermore, I use __FILE__ indirectly via assert(), which is scattered through driver code provided by the chip vendor. Therefore, __BASE_FILE__ is no option.