Merge pull request #4957 from julthomas/dev/jth/rsyslog-8.2208.0-gcc-lt-5

conf: Fix #pragma GCC diagnostic not allowed inside functions
This commit is contained in:
Rainer Gerhards 2022-08-19 08:44:12 +02:00 committed by GitHub
commit 1d1598dc53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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