From f636749ea2324c246dc652ac61de9e1975bbbbc9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 22 Oct 2025 12:52:10 -0400 Subject: [PATCH] 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 */ | ^ --- sys/unix/hints/include/compiler.370 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/unix/hints/include/compiler.370 b/sys/unix/hints/include/compiler.370 index 5ef6f801e..b686636a2 100755 --- a/sys/unix/hints/include/compiler.370 +++ b/sys/unix/hints/include/compiler.370 @@ -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