> On Apr 13, 2018, at 23:52 , Steffen Hirschmann > <steffen.hirschm...@ipvs.uni-stuttgart.de> wrote: > > On 13:22 Fri 13 Apr , Rick Mann via cfe-users wrote: >> I'm using `strrchr("/" __FILE__, '/') + 1`. Should that also get resolved? > Just have a look at a minimal example on godbolt: > https://godbolt.org/g/MRjGG3 > > Indeed the function call gets resolved at compile time. But that does > not mean that only the basename of __FILE__ is present in the binary. > No compiler that you can test on godbolt does this actually, neither > with -O3 nor with -Os.
And it's worse than that. We have a lot of third-party code that uses __FILE__ directly without trimming it. The best solution really would be a command-line option to modify the behavior of __FILE__. I hope the patch makes it in. I'm going to recommend a similar one for Swift. -- Rick Mann rm...@latencyzero.com _______________________________________________ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users