diff options
author | Omar Polo <op@omarpolo.com> | 2024-06-17 07:09:14 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-06-17 07:09:14 +0000 |
commit | bc5e9ae52576c9a0673dd2b7b7ddaadd05dd976e (patch) | |
tree | b262c6cd8903c003ea354691d47ffbaaea997fdc | |
parent | b9318a7cdc2442b409709c4e32d49301a8098b95 (diff) |
comment out stravis instead of adding -Wno-* for stupid gcc
gcc has a broken error checking for 'use-after-free' that can be triggered
by perfectly valid code. Since it's in a function (stravis) we don't use,
comment it out.
-rw-r--r-- | .cirrus.yml | 7 | ||||
-rw-r--r-- | compat/vis.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index c901406..c9de7df 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,6 +1,3 @@ -# gcc' -Werror=use-after-free gets tripped by vis.c: it sees a use -# after free where it's not possible and breaks the CI. - # seems that inside the CI it's not currently possible to bind to ::1 # so set HAVE_IPV6=no. @@ -9,7 +6,7 @@ linux_amd64_task: image: alpine:latest test_script: - apk add alpine-sdk linux-headers bison libretls-dev libevent-dev - - ./configure CFLAGS='-O2 -pipe -Wno-deprecated-declarations -Wno-use-after-free' -Werror + - ./configure CFLAGS='-O2 -pipe -Wno-deprecated-declarations' -Werror - make - make regress REGRESS_HOST="*" HAVE_IPV6=no @@ -18,7 +15,7 @@ linux_arm_task: image: alpine:latest test_script: - apk add alpine-sdk linux-headers bison libretls-dev libevent-dev - - ./configure CFLAGS='-O2 -pipe -Wno-deprecated-declarations -Wno-use-after-free' -Werror + - ./configure CFLAGS='-O2 -pipe -Wno-deprecated-declarations' -Werror - make - make regress REGRESS_HOST="*" HAVE_IPV6=no diff --git a/compat/vis.c b/compat/vis.c index 086d93b..943c361 100644 --- a/compat/vis.c +++ b/compat/vis.c @@ -238,6 +238,13 @@ strnvis(char *dst, const char *src, size_t siz, int flag) return (dst - start); } +#if notneeded +/* + * This function triggers stupid gcc into thinking that buf is used + * after realloc, breaking the build with -Werror. Since we don't + * need this in gmid, comment it out so that gcc can be happy. + */ + int stravis(char **outp, const char *src, int flag) { @@ -256,6 +263,7 @@ stravis(char **outp, const char *src, int flag) } return (len); } +#endif int strvisx(char *dst, const char *src, size_t len, int flag) |