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 <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
This commit is contained in:
Andrew Deason 2024-07-03 20:00:01 -05:00 committed by Michael Meffie
parent 9cb1aab5b5
commit e545f81f04
7 changed files with 16 additions and 6 deletions

7
CODING
View File

@ -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

View File

@ -17,7 +17,6 @@
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#define HC_DEPRECATED
#include <hcrypto/des.h>
#include <hcrypto/rand.h>

View File

@ -24,7 +24,6 @@
#include "kauth.h"
#define HC_DEPRECATED
#include <hcrypto/des.h>
#include <lock.h>

View File

@ -26,7 +26,6 @@
#include <afs/errmap_nt.h>
#endif
#define HC_DEPRECATED
#include <hcrypto/des.h>
#include <afs/com_err.h>

View File

@ -31,6 +31,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include <ctype.h>
#include <afs/cellconfig.h>
#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 <hcrypto/des.h>
#ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE

View File

@ -61,13 +61,13 @@
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#endif
#include <rx/xdr.h>
#include <rx/rx.h>
#define HC_DEPRECATED_CRYPTO
#include <hcrypto/md4.h>
#include <hcrypto/md5.h>
#include <hcrypto/des.h>

View File

@ -26,7 +26,10 @@
#include <roken.h>
#define HC_DEPRECATED
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include <hcrypto/des.h>
#include <rx/rxkad.h>