Fix GCC pragma.

Fix "error: #pragma GCC diagnostic not allowed inside functions".

Change-Id: Iaa7e39ac46975f00bc337b97875ba8b77295064a
Reviewed-on: https://code.wireshark.org/review/6355
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-01-06 15:44:19 -08:00
parent e3eab8391d
commit 85e69d4fca
1 changed files with 2 additions and 6 deletions

View File

@ -27,6 +27,7 @@
gboolean failed = FALSE;
DIAG_OFF(shadow)
void
run_tests(void)
{
@ -98,7 +99,6 @@ run_tests(void)
failed = TRUE;
}
DIAG_OFF(shadow)
/* check that finally is called on an uncaught exception */
ex_thrown = finally_called = 0;
TRY {
@ -114,7 +114,6 @@ run_tests(void)
ex_thrown++;
}
ENDTRY;
DIAG_ON(shadow)
if (finally_called != 1) {
printf("03: FINALLY called %u times (not 1) on uncaught exception\n", finally_called);
@ -127,7 +126,6 @@ run_tests(void)
}
DIAG_OFF(shadow)
/* check that finally is called on an rethrown exception */
ex_thrown = finally_called = 0;
TRY {
@ -150,7 +148,6 @@ run_tests(void)
finally_called ++;
}
ENDTRY;
DIAG_ON(shadow)
if (finally_called != 11) {
printf("04: finally_called = %u (not 11) on rethrown exception\n", finally_called);
@ -163,7 +160,6 @@ run_tests(void)
}
DIAG_OFF(shadow)
/* check that finally is called on an exception thrown from a CATCH block */
ex_thrown = finally_called = 0;
TRY {
@ -191,7 +187,6 @@ run_tests(void)
finally_called ++;
}
ENDTRY;
DIAG_ON(shadow)
if (finally_called != 11) {
printf("05: finally_called = %u (not 11) on exception thrown from CATCH\n", finally_called);
@ -206,6 +201,7 @@ run_tests(void)
if(failed == FALSE )
printf("success\n");
}
DIAG_ON(shadow)
int main(void)
{