[cfe-users] App security and the __FILE__ macro

Rick Mann via cfe-users cfe-users at lists.llvm.org
Thu Apr 12 15:38:12 PDT 2018


The higher-ups decided we needed penetration testing of our app. One of their concerns was that if you run the macOS strings tool on our binary and grep for /Users, you get a ton of absolute paths for source files in the project. This is because (I think) we use the __FILE__ macro as part of our logging, to log file:line information. I find this info a boon, and we log that even in release builds to help track down issues reported by customers. At run time, we trim off all of the path except for the filename and extension.

It would be great if there were a __FILENAME__ macro that did this for me. Is there any such thing?

Thanks!

-- 
Rick Mann
rmann at latencyzero.com





More information about the cfe-users mailing list