[libcxx] r349294 - [test] [ctime] Ignore -Wformat-zero-length warnings

Michal Gorny mgorny at gentoo.org
Sun Dec 16 01:18:31 PST 2018


Author: mgorny
Date: Sun Dec 16 01:18:31 2018
New Revision: 349294

URL: http://llvm.org/viewvc/llvm-project?rev=349294&view=rev
Log:
[test] [ctime] Ignore -Wformat-zero-length warnings

Explicitly disable the -Wformat-zero-length diagnostic when running
ctime tests, since one of the test cases passes zero-length format
string to strftime().  When strftime() is appropriately decorated
with __attribute__(format, ...), this caused the test to fail because
of this warning (e.g. on NetBSD).

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

Modified:
    libcxx/trunk/test/std/utilities/time/date.time/ctime.pass.cpp

Modified: libcxx/trunk/test/std/utilities/time/date.time/ctime.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/date.time/ctime.pass.cpp?rev=349294&r1=349293&r2=349294&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/date.time/ctime.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/date.time/ctime.pass.cpp Sun Dec 16 01:18:31 2018
@@ -26,6 +26,10 @@
 #endif
 #endif
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+#endif
+
 int main()
 {
     std::clock_t c = 0;




More information about the libcxx-commits mailing list