Our code uses __FILE__
to print code locations in a log file.
__FILE__
to print the filename ONLY, no path.
However, we just noticed that while source (.cpp
files) correctly print just the filename, the headers (.h
files) print the full path. This exposes our build server's path on customer instal开发者_开发技巧lations, which is confusing at best.
I have researched the /FC
(full pathnames) compile option and how it relates to the /ZI
and /Zi
(debug info generation) compile options. Short version - /ZI
implies /FC
. We are currently using /Zi
, but we are not using either /ZI
or /FC
, so we should be fine.
We are using a project-wide precompiled header (PCH), but none of the headers included in the PCH use __FILE__
, so that seems irrelevant.
What's going on here?
Is there possibly a latent compile option I'm triggering? Does anyone know of a workaround that doesn't involve calling run-time string manipulation functions?This is asserted as "by design" in this feedback article. Consider a post-processing step that hacks the paths the way you want them.
精彩评论