[compiler-rt] r202297 - Reapply r201910. MSVC gets __func__ defined explicitly, even though it

Reid Kleckner rnk at google.com
Wed Feb 26 13:19:27 PST 2014


On Wed, Feb 26, 2014 at 12:51 PM, Aaron Ballman <aaron at aaronballman.com>wrote:

> On Wed, Feb 26, 2014 at 3:45 PM, Timur Iskhodzhanov <timurrrr at google.com>
> wrote:
> > Hi Joerg,
> >
> > I don't see where __func__ is explicitly defined and this does break
> > my ASan Windows build.
>
> It's set via CMake in r202296.
>

The define didn't make it through to the compile line:
[43/54] Building CXX object
projects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.i386.dir\sanitizer_common.cc.obj
FAILED: "C:/Program Files (x86)/CMake 2.8/bin/cmcldeps.exe" CXX
..\projects\compiler-rt\lib\sanitizer_common\sanitizer_common.cc
"projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_common.cc.obj.d"
projects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.i386.dir\sanitizer_common.cc.obj
 "Note: including file: "  "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/cl.exe" C:\PROGRA~2\MICROS~4.0\VC\bin\cl.exe   /nologo /TP
/DWIN32 /D_WINDOWS /W3   /MT /O2 /Ob2
-Iprojects\compiler-rt\lib\sanitizer_common
-I..\projects\compiler-rt\lib\sanitizer_common -Iinclude -I..\include
 -UNDEBUG -wd4146 -wd4180 -wd4244 -wd4267 -wd4345 -wd4351 -wd4355 -wd4503
-wd4624 -wd4800 -wd4291 -w14062 -we4238  /MT /Oy- /GS- /O2 /Zi /wd4722 /GR-
 -DSANITIZER_NEEDS_SEGV=0 -D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS
/Foprojects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.i386.dir\sanitizer_common.cc.obj
/Fdprojects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.i386.dir/
/FS -c ..\projects\compiler-rt\lib\sanitizer_common\sanitizer_common.cc
..\projects\compiler-rt\lib\sanitizer_common\sanitizer_common.cc(96) :
error C2065: '__func__' : undeclared identifier

Sorry I didn't get back to you about this earlier.  I just don't think we
should try to define macros in the implementer's namespace.  Typically we
do things like LLVM_FUNC or LLVM_CONSTEXPR, but what's the real motivation?
 You said __FUNCTION__ has weird semantics.  Can you elaborate on the
downsides?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140226/6a0c2320/attachment.html>


More information about the llvm-commits mailing list