From e545f81f04013d6522e5d24cb7308990dbfe8320 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 3 Jul 2024 20:00:01 -0500 Subject: [PATCH] Stop defining HC_DEPRECATED Heimdal's hcrypto declares various DES functions as deprecated. We use these functions in various files, and so we inhibit the -Wdeprecated-declarations warning so we can build with --enable-checking. Heimdal declares these functions as deprecated using the HC_DEPRECATED (or HC_DEPRECATED_CRYPTO) macro, which conditionally expands to __attribute__((deprecated)) depending on the platform. If we define HC_DEPRECATED ourselves to nothing before including the relevant header file, those functions will effectively not be declared deprecated. Some of our source files do this to avoid the -Wdeprecated-declarations warning. Some of our code does one of these to avoid the warning, and some does both. We should pick one or the other, and be consistent about it. In this commit, get rid of defining HC_DEPRECATED (and HC_DEPRECATED_CRYPTO) ourselves, and just inhibit the relevant warning the same way we do for all other warnings. All instances of this are also currently missing from the "Inhibited warnings" section in CODING. Add all instances to that list. Change-Id: I4d7ece94be22457ceefbe52b6ec286e67423e8cb Reviewed-on: https://gerrit.openafs.org/15776 Tested-by: BuildBot Reviewed-by: Michael Meffie --- CODING | 7 +++++++ src/auth/authcon.c | 1 - src/kauth/kaprocs.c | 1 - src/kauth/krb_udp.c | 1 - src/libafscp/afscp_util.c | 5 ++++- src/rxkad/ticket5.c | 2 +- tests/common/rxkad.c | 5 ++++- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CODING b/CODING index 9795b8d7a7..9f19ea8965 100644 --- a/CODING +++ b/CODING @@ -373,7 +373,14 @@ rxkad/ticket5.c : format-truncation : inside included file v5der.c in the two snprintf calls raise format-truncation warnings due to the arithmetic on tm_year and tm_mon fields +rxkad/ticket5.c : deprecated : hcrypto single-DES lwp/process.c : dangling-pointer : Ignore the legitimate use of saving the address of a stack variable src/rxkad/test/stress_c.c : deprecated : hcrypto single-DES +auth/authcon.c : deprecated : hcrypto single-DES +kauth/kaprocs.c : deprecated : hcrypto single-DES +kauth/krb_udp.c : deprecated : hcrypto single-DES +libafscp/afscp_util.c + : deprecated : hcrypto single-DES +tests/common/rxkad.c : deprecated : hcrypto single-DES diff --git a/src/auth/authcon.c b/src/auth/authcon.c index e50378788a..1a428d2f68 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -17,7 +17,6 @@ # pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif -#define HC_DEPRECATED #include #include diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index dbfba02273..ae6c91cbdd 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -24,7 +24,6 @@ #include "kauth.h" -#define HC_DEPRECATED #include #include diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index a5960f35f4..18698ed569 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -26,7 +26,6 @@ #include #endif -#define HC_DEPRECATED #include #include diff --git a/src/libafscp/afscp_util.c b/src/libafscp/afscp_util.c index 0e5a0e28c0..954153e87b 100644 --- a/src/libafscp/afscp_util.c +++ b/src/libafscp/afscp_util.c @@ -31,6 +31,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif + #include #include #ifndef AFSCONF_CLIENTNAME @@ -47,7 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "afscp.h" #include "afscp_internal.h" -#define HC_DEPRECATED #include #ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE diff --git a/src/rxkad/ticket5.c b/src/rxkad/ticket5.c index bc1c855151..0820ce6e65 100644 --- a/src/rxkad/ticket5.c +++ b/src/rxkad/ticket5.c @@ -61,13 +61,13 @@ #include #ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wdeprecated-declarations" # pragma GCC diagnostic warning "-Wimplicit-function-declaration" #endif #include #include -#define HC_DEPRECATED_CRYPTO #include #include #include diff --git a/tests/common/rxkad.c b/tests/common/rxkad.c index 5f180ba47e..c111da2c7f 100644 --- a/tests/common/rxkad.c +++ b/tests/common/rxkad.c @@ -26,7 +26,10 @@ #include -#define HC_DEPRECATED +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif + #include #include