aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2018-01-03 14:55:52 -0500
committerDavid Benjamin <davidben@google.com>2018-01-03 14:55:52 -0500
commit1acf8c752ee8e20888e5ae887846f034b09c5ca9 (patch)
treeada13a416941590ee2c5881bd3a1096167b5cb24
parentba6ecedede74521490f36b6aea08f91fdad6d201 (diff)
downloadgoogletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.tar.gz
googletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.tar.bz2
googletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.zip
Also define GTEST_ATTRIBUTE_PRINTF_ in clang-cl.
clang-cl is clang for Windows running in MSVC mode. Chromium uses it for Windows builds. clang-cl is weird in that it defines __clang__ and _MSC_VER, but *NOT* __GNUC__. This is vaguely analogous to how normal clang defines __clang__ (what it is) and __GNUC__ (what it is compatible with). However, clang-cl still implements most GCC extensions, being clang. Notably, the way to control -Wformat-literal is still with __attribute__((__format__)). For better error-checking and strict -Wformatl-literal compatibility (see 53c478d639b8eebd2942e88266610ebc79c541f6), define GTEST_ATTRIBUTE_PRINTF_ in clang-cl too.
-rw-r--r--googletest/include/gtest/internal/gtest-port.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 8778bddd..58ab7fdf 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -879,7 +879,7 @@ using ::std::tuple_size;
#endif
// Use this annotation before a function that takes a printf format string.
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
+#if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
# if defined(__MINGW_PRINTF_FORMAT)
// MinGW has two different printf implementations. Ensure the format macro
// matches the selected implementation. See