build: Fix #pragma GCC diagnostic not allowed inside functions

Commit 829a6f6 "CI: improve use of github action matrix feature;
optimization" has introduced use of #pragma GCC diagnostic in function
doNameLine() of runtime/conf.c. This is not supported by old compilers
like GCC 4.4.7 on el6.
This commit is contained in:
Julien Thomas 2022-08-10 17:39:58 +02:00
parent f901f113d2
commit 21b5e0225e

View File

@ -110,8 +110,15 @@
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
#define PRAGMA_IGNORE_Wdeprecated_declarations \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define PRAGMA_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
#if __GNUC__ >= 5
#define PRAGMA_DIAGNOSTIC_PUSH \
_Pragma("GCC diagnostic push")
#define PRAGMA_DIAGNOSTIC_POP \
_Pragma("GCC diagnostic pop")
#else
#define PRAGMA_DIAGNOSTIC_PUSH
#define PRAGMA_DIAGNOSTIC_POP
#endif
#else
#define PRAGMA_INGORE_Wswitch_enum
#define PRAGMA_IGNORE_Wsign_compare