From: Alan T. DeKok Date: Sun, 17 Jan 2021 14:22:46 +0000 (-0500) Subject: use pre-existing DIAG_OFF macros X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40576df2e926286bdb80b55c3852ca65b4755b5e;p=thirdparty%2Ffreeradius-server.git use pre-existing DIAG_OFF macros --- diff --git a/src/lib/json/base.h b/src/lib/json/base.h index a12c1c56b52..6816817114a 100644 --- a/src/lib/json/base.h +++ b/src/lib/json/base.h @@ -34,11 +34,10 @@ RCSIDH(json_h, "$Id$") #ifdef HAVE_JSON # if defined(HAVE_JSONMC_JSON_H) -#if defined(__APPLE__) && defined(__clang__) -#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" -#endif - +DIAG_OFF(documentation-deprecated-sync) # include +DIAG_ON(documentation-deprecated-sync); + # elif defined(HAVE_JSON_JSON_H) # include # else diff --git a/src/lib/json/json_missing.h b/src/lib/json/json_missing.h index 8c5b4aca67d..63967cda3c0 100644 --- a/src/lib/json/json_missing.h +++ b/src/lib/json/json_missing.h @@ -29,11 +29,10 @@ RCSIDH(jsonc_missing_h, "$Id$") #ifdef HAVE_JSON # if defined(HAVE_JSONMC_JSON_H) -#if defined(__APPLE__) && defined(__clang__) -#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" -#endif - +DIAG_OFF(documentation-deprecated-sync) # include +DIAG_ON(documentation-deprecated-sync) + # elif defined(HAVE_JSON_JSON_H) # include # else diff --git a/src/lib/util/dbuff_tests.c b/src/lib/util/dbuff_tests.c index 5949100dd8e..77510f47242 100644 --- a/src/lib/util/dbuff_tests.c +++ b/src/lib/util/dbuff_tests.c @@ -13,9 +13,7 @@ * the floats are equal on a *bit* level, not on a *semantic* * level. */ -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wfloat-equal" -#endif +DIAG_OFF(float-equal) #define TEST_CHECK_LEN(_got, _exp) \ do { \ diff --git a/src/protocols/radius/abinary.c b/src/protocols/radius/abinary.c index bac382f4f53..27b610ec4f5 100644 --- a/src/protocols/radius/abinary.c +++ b/src/protocols/radius/abinary.c @@ -31,9 +31,7 @@ RCSID("$Id$") #include -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wflexible-array-extensions" -#endif +DIAG_OFF(flexible-array-extensions) /* * Two types of filters are supported, GENERIC and IP. The identifiers diff --git a/src/protocols/tacacs/tacacs.h b/src/protocols/tacacs/tacacs.h index a318cd15974..701f67832e2 100644 --- a/src/protocols/tacacs/tacacs.h +++ b/src/protocols/tacacs/tacacs.h @@ -258,9 +258,7 @@ typedef struct CC_HINT(__packed__) { uint8_t body[]; } fr_tacacs_packet_acct_reply_hdr_t; -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wflexible-array-extensions" -#endif +DIAG_OFF(flexible-array-extensions) typedef struct CC_HINT(__packed__) { fr_tacacs_packet_hdr_t hdr; @@ -281,6 +279,8 @@ typedef struct CC_HINT(__packed__) { }; } fr_tacacs_packet_t; +DIAG_ON(flexible-array-extensions) + extern char const *fr_tacacs_packet_codes[]; /** Used as the decoder ctx