digitalmars.D - __FILE_FULL_PATH__'s behaviour after #line
- Longinus (18/18) Oct 18 2023 Provided not located in the root, those two code samples have
Provided not located in the root, those two code samples have different behaviours: ```d #line 42 "file.c" pragma(msg, __FILE_FULL_PATH__); //outputs the compiler's CWD ~ __FILE__ ``` ```d #line 42 "/file.c" pragma(msg, __FILE_FULL_PATH__); //output omits DMD's CWD static assert(__FILE_FULL_PATH__ == __FILE__); //succeeds ``` Looks like [this function](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/r ot/filename.d#L161) is responsible for this. Is this the intended behaviour? Is it documented somewhere? The first behaviour is weird and used to just respond with what's written in the `#line` directive, before being [changed by this commit](https://github.com/dlang/dmd/commit/1927521a0450c9904a9ed8bada1a2b5f9a506718).
Oct 18 2023