[Git][NTPsec/ntpsec][master] Suppress format warnings under GCC.

Amar Takhar gitlab at mg.gitlab.com
Sat Dec 5 12:37:02 UTC 2015


Amar Takhar pushed to branch master at NTPsec / ntpsec


Commits:
7ed56e32 by Amar Takhar at 2015-12-05T07:36:43Z
Suppress format warnings under GCC.

- - - - -


1 changed file:

- tests/libntp/msyslog.c


Changes:

=====================================
tests/libntp/msyslog.c
=====================================
--- a/tests/libntp/msyslog.c
+++ b/tests/libntp/msyslog.c
@@ -90,6 +90,11 @@ TEST(msyslog, msnprintfHangingPercent)
 	ZERO(exp_buf);
 	ZERO(act_buf);
 /* warning: format string contains '\0' within the string body [-Wformat] */
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-contains-nul"
+#pragma GCC diagnostic ignored "-Wformat="
+#endif
 #ifdef __clang__
 #  pragma clang diagnostic push
 #  pragma clang diagnostic ignored "-Wformat"
@@ -99,6 +104,9 @@ TEST(msyslog, msnprintfHangingPercent)
 #ifdef __clang__
 #  pragma clang diagnostic pop
 #endif
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 
 	TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
 	TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7ed56e320f26b35f31990984611e7e16bd70d948
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151205/e12dfaba/attachment.html>


More information about the vc mailing list