Browse code

fix compilation warning for gcc 12.x (GH #3073)

Henning Westerholt authored on 11/04/2022 07:40:09
Showing 1 changed files
... ...
@@ -283,7 +283,7 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
283 283
 	# sed with POSIX.1 regex doesn't support |, + or ?
284 284
 	# (darwin, solaris ...) => this complicated expression
285 285
 	MKDEP=$(CC) -MM -MG
286
-	#transform gcc version into 2.9x or 3.0
286
+	#transform gcc version into some well-known versions, or 9 for newer versions
287 287
 	CC_SHORTVER:=$(shell echo "$(CC_VER)" | cut -d" " -f 2| \
288 288
 				 sed -e 's/[^0-9]*-\(.*\)/\1/'| \
289 289
 				 sed -e 's/2\.9.*/2.9x/' \
... ...
@@ -310,7 +310,9 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
310 310
 					-e 's/10\.[0-9]\..*/9.0+/' \
311 311
 					-e 's/10\.[0-9]$$/9.0+/' \
312 312
 					-e 's/11\.[0-9]\..*/9.0+/' \
313
-					-e 's/11\.[0-9]$$/9.0+/')
313
+					-e 's/11\.[0-9]$$/9.0+/' \
314
+					-e 's/12\.[0-9]\..*/9.0+/' \
315
+					-e 's/12\.[0-9]$$/9.0+/')
314 316
 ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
315 317
 	# dependencies can be generated on-the-fly while compiling *.c
316 318
 	CC_MKDEP_OPTS=-MMD -MP