summaryrefslogtreecommitdiff
path: root/libcxx/test
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-12-16 09:18:31 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-12-16 09:18:31 +0000
commitc58dea983a2ad4b08de3c14577be4674b0420fcc (patch)
tree06ad4c9797ee2a73e5f590827b05b277d076ff3d /libcxx/test
parentc20c3d2c429ef395a67dbfaa1f6152c3cfbc769c (diff)
[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
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/utilities/time/date.time/ctime.pass.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
index cd1f32be2bc..f6dd75d2484 100644
--- a/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
+++ b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
@@ -26,6 +26,10 @@
#endif
#endif
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+#endif
+
int main()
{
std::clock_t c = 0;