Inhibit -Wdeprecated-declarations via CFLAGS

Currently, we inhibit various -Wdeprecated-declarations warnings via
"#pragma GCC diagnostic warning". Some older compilers (like gcc 4.1 on
RHEL5) don't understand the pragma, but still need the warning inhibited
in order to build with --enable-checking. So just inhibit this warning
via command-line CFLAGS instead of using #pragma directives.

One source file, tests/auth/superuser-t.c, was inhibiting the
-Wdeprecated-declaractions warning unnecessarily (it has not been needed
since commit 5815a04cf1 (tests: Move token faking code to its own
file)). Just remove the warning inhibition there, instead.

Change-Id: I52b1aeeac8699f9a4820626e9f1349f8cd380585
Reviewed-on: https://gerrit.openafs.org/15777
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Andrew Deason 2024-07-03 20:15:22 -05:00 committed by Michael Meffie
parent e545f81f04
commit 790b3108df
15 changed files with 16 additions and 31 deletions

View File

@ -123,6 +123,7 @@ acfg_errors.c: acfg_errors.et
cellconfig.h: acfg_errors.et cellconfig.p.h
${COMPILE_ET_H} -p ${srcdir} acfg_errors -h cellconfig
CFLAGS_authcon.lo = @CFLAGS_NODEPRECATED_DECLARATIONS@
authcon.lo: cellconfig.h
cellconfig.lo: cellconfig.h
copyauth.o: cellconfig.h

View File

@ -13,10 +13,6 @@
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include <hcrypto/des.h>
#include <hcrypto/rand.h>

View File

@ -620,6 +620,7 @@ CFLAGS_NOIMPLICIT_FALLTHROUGH=
CFLAGS_NOCAST_FUNCTION_TYPE=
CFLAGS_NODANGLING_POINTER=
CFLAGS_NOSTRICT_PROTOTYPES=
CFLAGS_NODEPRECATED_DECLARATIONS=
XCFLAGS_NOCHECKING="$XCFLAGS"
if test "x$GCC" = "xyes"; then
@ -637,6 +638,7 @@ if test "x$GCC" = "xyes"; then
CFLAGS_NOUNUSED="-Wno-unused"
CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
CFLAGS_NOSTRICT_PROTOTYPES=-Wno-strict-prototypes
CFLAGS_NODEPRECATED_DECLARATIONS=-Wno-deprecated-declarations
AX_APPEND_COMPILE_FLAGS([-Wno-implicit-fallthrough],
[CFLAGS_NOIMPLICIT_FALLTHROUGH], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-dangling-pointer],
@ -739,6 +741,7 @@ AC_SUBST(CFLAGS_NOIMPLICIT_FALLTHROUGH)
AC_SUBST(CFLAGS_NOCAST_FUNCTION_TYPE)
AC_SUBST(CFLAGS_NODANGLING_POINTER)
AC_SUBST(CFLAGS_NOSTRICT_PROTOTYPES)
AC_SUBST(CFLAGS_NODEPRECATED_DECLARATIONS)
AC_SUBST(CFLAGS_WERROR)
AC_SUBST(XCFLAGS64)
AC_SUBST(XLDFLAGS)

View File

@ -122,6 +122,8 @@ kaserver.o: kaserver.c ${INCLS} AFS_component_version_number.o
kadatabase.o: kadatabase.c ${INCLS}
CFLAGS_kaprocs.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
CFLAGS_kaprocs.lo = @CFLAGS_NODEPRECATED_DECLARATIONS@
kaprocs.o: kaprocs.c ${INCLS} kaport.h
kaerrors.c: kaerrors.et
@ -239,6 +241,8 @@ kdb: kdb.o ${INCLS} ${LIBS} libkauth.a
kdb.o: kdb.c AFS_component_version_number.o
CFLAGS_krb_udp.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
CFLAGS_krb_udp.lo = @CFLAGS_NODEPRECATED_DECLARATIONS@
krb_udp.o: krb_udp.c kaserver.h kautils.h kauth.h prot.h ${TOP_INCDIR}/lwp.h AFS_component_version_number.o
krb_udp: krb_udp.o libkauth.a $(KLIBS)

View File

@ -18,10 +18,6 @@
# include <sys/resource.h>
#endif
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include "kauth.h"
#include <hcrypto/des.h>

View File

@ -18,10 +18,6 @@
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#ifdef AFS_NT40_ENV
#include <afs/errmap_nt.h>
#endif

View File

@ -39,6 +39,7 @@ depinstall: \
${TOP_INCDIR}/afs/afscp.h: afscp.h
${INSTALL_DATA} $? $@
CFLAGS_afscp_util.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
CPPFLAGS_afscp_util.o = $(KRB5CPPFLAGS)
CPPFLAGS_afscp_server.o = $(KRB5CPPFLAGS)

View File

@ -31,10 +31,6 @@ 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

View File

@ -95,6 +95,8 @@ rxkad_common.o rxkad_common.lo: rxkad.h
rxkad_server.o rxkad_server.lo: rxkad.h
ticket5.o ticket5.lo: rxkad.h
ticket.o ticket.lo: rxkad.h
CFLAGS_ticket5.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
CFLAGS_ticket5.lo = @CFLAGS_NODEPRECATED_DECLARATIONS@
tcrypt.o: tcrypt.c AFS_component_version_number.o

View File

@ -37,7 +37,7 @@ THLIBS= ${TOP_LIBDIR}/libcmd.a \
${LIB_roken} \
${MT_LIBS} -lpthread
THRULE = ${MT_CC} $(COMMON_CFLAGS) $(MT_CFLAGS)
THRULE = ${MT_CC} $(COMMON_CFLAGS) $(MT_CFLAGS) $(CFLAGS_$(@))
fc_test_OBJS=fc_test.o
@ -92,6 +92,7 @@ stress_s.o: stress_errs.h
stress.o: ${HEADERS}
stress_c.o: ${HEADERS}
CFLAGS_stress_c.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
stress_s.o: ${HEADERS}
fc_test.o: ${HEADERS}
CFLAGS_fc_test.o = -I$(TOP_SRCDIR)/rxkad -I$(TOP_OBJDIR)/src/rxkad
@ -99,6 +100,7 @@ CFLAGS_fc_test.o = -I$(TOP_SRCDIR)/rxkad -I$(TOP_OBJDIR)/src/rxkad
th_stress.o: stress.c ${HEADERS}
${THRULE} -c $(srcdir)/stress.c -o th_stress.o
CFLAGS_th_stress_c.o = @CFLAGS_NODEPRECATED_DECLARATIONS@
th_stress_c.o: stress_c.c ${HEADERS}
${THRULE} -c $(srcdir)/stress_c.c -o th_stress_c.o

View File

@ -14,10 +14,6 @@
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include <afs/stds.h>
#include <afs/com_err.h>

View File

@ -61,7 +61,6 @@
#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#endif

View File

@ -32,10 +32,6 @@
#include <signal.h>
#include <time.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
#include <afs/com_err.h>
@ -43,7 +39,6 @@
#include <rx/rxkad.h>
#include <rx/rx_identity.h>
#include <hcrypto/des.h>
#include <tests/tap/basic.h>
#include "test.h"

View File

@ -15,6 +15,8 @@ LT_deps = $(top_builddir)/tests/tap/libafstest_tap.la \
all: libafstest_common.la
CFLAGS_rxkad.lo = @CFLAGS_NODEPRECATED_DECLARATIONS@
# This library is just used internally for our tests, so use
# LT_LDLIB_shlib_internal so we don't need to manage a .sym export list.
libafstest_common.la: $(LT_objs) $(LT_deps)

View File

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