github: Add -Wno-stringop-overflow to the GCC/CMake builds

CMake builds with -O3 by default, while autotools builds with -O2.

When optimizing in -O3 mode, GCC finds things to warn about with
-Wno-stringop-overflow that it doesn't find in -O2 mode. (This
happens at least with GCC 11, found in Ubuntu 22.04.)
This commit is contained in:
Martin Storsjo 2023-10-06 12:44:05 +03:00
parent 23b030f80e
commit 48255d057a
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build - name: Build
run: | run: |
cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-stringop-overflow"
cmake --build build cmake --build build
macos-autotools: macos-autotools:
@ -71,7 +71,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build - name: Build
run: | run: |
cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-stringop-overflow"
cmake --build build cmake --build build
msys-cmake: msys-cmake: