]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
CI: disable -O2 for Coverity after v9.1.0429
authorChristian Brabandt <cb@256bit.org>
Wed, 22 May 2024 05:53:23 +0000 (07:53 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 22 May 2024 05:56:24 +0000 (07:56 +0200)
gcc -O2 outputs this warning and turns it into an error when running
Coverity action:

```
eval.c: In function ‘echo_string_core’:
cc1: warning: function may return address of local variable [-Wreturn-local-addr]
eval.c:6495:12: note: declared here
 6495 |     char_u buf[MAX_FUNC_NAME_LEN];
      |            ^~~
```

This seems to be a false positive, so disable -O2 for Coverity
specifically.

Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/workflows/coverity.yml

index 290f7e4e4b86ff2e95d9a54cdbddf55de013bf59..90a6e9ff0c43013a973efdfc0f6bad6fe40f62b3 100644 (file)
@@ -63,6 +63,9 @@ jobs:
           # Append various warning flags to CFLAGS.
           sed -i -f ci/config.mk.sed src/auto/config.mk
           sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk
+          # -O2 gives false warning and turns it into an error:
+          # warning: function may return address of local variable [-Wreturn-local-addr]
+          sed -i 's/-O2 \?//' src/auto/config.mk
 
       - name: Build/scan vim
         if: env.TOKEN