[libcxx-commits] [libcxx] b30e429 - [libcxx] [test] Avoid conflicting definitions of _CRT_SECURE_NO_WARNINGS

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 20 09:44:29 PDT 2020


Author: Martin Storsjö
Date: 2020-10-20T19:44:21+03:00
New Revision: b30e42922aeaeb70efbfcf7c2132dae21239a023

URL: https://github.com/llvm/llvm-project/commit/b30e42922aeaeb70efbfcf7c2132dae21239a023
DIFF: https://github.com/llvm/llvm-project/commit/b30e42922aeaeb70efbfcf7c2132dae21239a023.diff

LOG: [libcxx] [test] Avoid conflicting definitions of _CRT_SECURE_NO_WARNINGS

This is defined both by libcxx/utils/libcxx/test/config.py (for
any windows target) and msvc_stdlib_force_include.h (when testing
specifically the MSVC C++ library).

The command line define (-D_CRT_SECURE_NO_WARNINGS) defines it to the
value 1; change the header define to match that.

Keeping both instances, to keep the fix for cases when not building
in cases that don't use config.py.

Also remove a comment about whether this can be removed; it can't at
least be removed altogether - doing that breaks a number of tests that
otherwise succeed.

Differential Revision: https://reviews.llvm.org/D89588

Added: 
    

Modified: 
    libcxx/test/support/msvc_stdlib_force_include.h
    libcxx/utils/libcxx/test/config.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/msvc_stdlib_force_include.h b/libcxx/test/support/msvc_stdlib_force_include.h
index 0869be349e23..bd83bee22ce7 100644
--- a/libcxx/test/support/msvc_stdlib_force_include.h
+++ b/libcxx/test/support/msvc_stdlib_force_include.h
@@ -14,7 +14,7 @@
 
 #ifndef _LIBCXX_IN_DEVCRT
     // Silence warnings about CRT machinery.
-    #define _CRT_SECURE_NO_WARNINGS
+    #define _CRT_SECURE_NO_WARNINGS 1
 
     // Avoid assertion dialogs.
     #define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()

diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index d32b0ee88248..0d21aa17afd2 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -272,7 +272,6 @@ def configure_compile_flags(self):
         compile_flags_str = self.get_lit_conf('compile_flags', '')
         self.cxx.compile_flags += shlex.split(compile_flags_str)
         if self.target_info.is_windows():
-            # FIXME: Can we remove this?
             self.cxx.compile_flags += ['-D_CRT_SECURE_NO_WARNINGS']
             # Don't warn about using common but nonstandard unprefixed functions
             # like chdir, fileno.


        


More information about the libcxx-commits mailing list