suppress dozens of new compiler warnings with clang-21

Turn off default -Wdeprecated-octal-literals warning with clang-21

One example of many:

In file included from objects.c:22:
../include/objects.h:137:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  137 | PROJECTILE("arrow", NoDes,
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
In file included from objects.c:22:
../include/objects.h:140:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  140 | PROJECTILE("elven arrow", "runed arrow",
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
In file included from objects.c:22:
../include/objects.h:143:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  143 | PROJECTILE("orcish arrow", "crude arrow",
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
This commit is contained in:
nhmall
2025-10-22 12:52:10 -04:00
parent 7e3586acad
commit f636749ea2

View File

@@ -98,6 +98,7 @@ CXX=clang++ -std=gnu++11
# clang-specific follows
CLANGGTEQ12 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 12)
CLANGGTEQ14 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 14)
CLANGGTEQ21 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 21)
ifeq "$(CLANGGTEQ12)" "1"
CFLAGS+=-Wimplicit-fallthrough
endif
@@ -109,6 +110,9 @@ else
# older versions complain about things newer ones don't without this
CFLAGS+=-Wno-missing-field-initializers
endif
ifeq "$(CLANGGTEQ21)" "1"
CFLAGS+=-Wno-deprecated-octal-literals
endif
# none
endif # clang-specific ends here