summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-02-10 16:15:34 +0100
committerYves Orton <demerphq@gmail.com>2023-02-13 09:42:15 +0800
commit845f95ae0fa61f7b3ba9036a50e8daba554e5f38 (patch)
treedfdb92d64fc8a871939a715b0c638bdd6a5c841f /cflags.SH
parent5e2af7a00aef25d0f21505fb700447117af982cc (diff)
downloadperl-845f95ae0fa61f7b3ba9036a50e8daba554e5f38.tar.gz
cflags.SH - add -Wno-use-after-free on gcc 12/13
This works around an overly eager/buggy use-after-free warning detection in gcc 12/13, which gets upset if we copy a pointer into a UV and then realloc the pointer and then use the UV value for diagnostics. Since the copied value is no longer a pointer gcc should not warn, as we are not "using" the pointer, just printing it out as a number. The gcc folks have been informed. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108115 Fixes #20601.
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH13
1 files changed, 13 insertions, 0 deletions
diff --git a/cflags.SH b/cflags.SH
index 443f5fcc96..d38e0a009b 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -379,6 +379,19 @@ esac
;;
esac
+# gcc version 12 and 13 are overly aggressive with use-after-free warnings
+# and have false positives on code that shouldn't warn, and they haven't
+# sorted it out yet. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108115
+case "$gccversion" in
+"1"[23]*)
+ for f in -Wno-use-after-free
+ do
+ echo "cflags.SH: Adding $f because of false positives in gccversion '$gccversion'"
+ warn="$warn $f"
+ done
+;;
+esac
+
echo "cflags.SH: cc = $cc"
echo "cflags.SH: ccflags = $ccflags"
echo "cflags.SH: stdflags = $stdflags"