Module Name:    src
Committed By:   rin
Date:           Thu Aug  3 14:55:54 UTC 2023

Modified Files:
        src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: Revert CC_WNO_USE_AFTER_FREE

This is an undefined behavior in general. Implementation details of
pointer are not defined in C standards; it is not necessarily address
of memory objects.

Pointed out by uwe@. Thanks!!


To generate a diff of this commit:
cvs rdiff -u -r1.1348 -r1.1349 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1348 src/share/mk/bsd.own.mk:1.1349
--- src/share/mk/bsd.own.mk:1.1348	Thu Aug  3 13:33:26 2023
+++ src/share/mk/bsd.own.mk	Thu Aug  3 14:55:54 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1348 2023/08/03 13:33:26 rin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1349 2023/08/03 14:55:54 rin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -697,11 +697,6 @@ CC_WNO_RETURN_LOCAL_ADDR=	${${ACTIVE_CC}
 CC_WNO_STRINGOP_OVERFLOW=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
 CC_WNO_STRINGOP_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
 
-# -Wuse-after-free for GCC 12 is premature. It fires on a common idiom:
-#	newbuf = realloc(buf, size); p = newbuf + (p - buf);
-# Let shut this up for GCC 12 (with hoping it gets improved for 13!).
-CC_WNO_USE_AFTER_FREE=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 12:? -Wno-use-after-free :}
-
 # For each ${MACHINE_CPU}, list the ports that use it.
 MACHINES.aarch64=	evbarm
 MACHINES.alpha=		alpha

Reply via email to