summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-09-19 14:22:13 +1000
committerKeith Packard <keithp@keithp.com>2014-09-18 22:28:27 -0700
commit28337cb14e4347e1dd7936c5393a22e042866687 (patch)
tree5d186f48f5403f0c360f2bb2f6df717be53afbe4 /test
parent7e6bd546846964fd9b8c2a06dea4782a552b62d7 (diff)
xserver: Move 'pragma GCC diagnostic' outside functions
$ gcc --version gcc (Gentoo 4.4.3-r2 p1.2) 4.4.3 /jhbuild/checkout/xorg/xserver/os/log.c: In function ‘LogInit’: /jhbuild/checkout/xorg/xserver/os/log.c:199: error: #pragma GCC diagnostic not allowed inside functions /jhbuild/checkout/xorg/xserver/os/log.c:201: warning: format not a string literal, argument types not checked /jhbuild/checkout/xorg/xserver/os/log.c:212: error: #pragma GCC diagnostic not allowed inside functions /jhbuild/checkout/xorg/xserver/os/log.c:214: warning: format not a string literal, argument types not checked etc. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'test')
-rw-r--r--test/signal-logging.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/signal-logging.c b/test/signal-logging.c
index 432012195..3d2d04801 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -113,12 +113,13 @@ double float_tests[] = { 0, 5, 0.1, 0.01, 5.2342, 10.2301,
-1, -2.00, -0.6023, -1203.30
};
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverflow"
+
static void
number_formatting(void)
{
int i;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Woverflow"
long unsigned int unsigned_tests[] = { 0,/* Zero */
5, /* Single digit number */
12, /* Two digit decimal number */
@@ -141,7 +142,6 @@ number_formatting(void)
-0x15D027BF211B37A, /* Large > 32 bit number */
-0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
} ;
-#pragma GCC diagnostic pop
for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++)
assert(check_number_format_test(unsigned_tests[i]));
@@ -152,6 +152,7 @@ number_formatting(void)
for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++)
assert(check_float_format_test(float_tests[i]));
}
+#pragma GCC diagnostic pop
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"