Fix broken ci and enable higher level optimization (#220)

* [ci] fix broken ci

* [ci] enable higher optimization level and lto

higher optimization levels enable more warnings and deeper analysis.
likewise, lto can catch a couple errors which typically goes unnoticed
without it.
This commit is contained in:
N-R-K 2022-02-20 07:55:17 +00:00 committed by GitHub
parent 79556e9b02
commit 3cf4fc5e81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ jobs:
- uses: actions/checkout@v2
- name: dep
run: |
sudo apt-get update
sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
libxft2 libxft-dev libexif12 libexif-dev \
gcc clang
@ -25,12 +26,14 @@ jobs:
# vanilla flags
CFLAGS="-std=c99 -Wall -pedantic"
# extra flags
CFLAGS+=" -O3 -flto"
CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
# silence
CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
export CFLAGS
export LDFLAGS="$CFLAGS"
export OPT_DEP_DEFAULT=1
echo "### GCC BUILD ###" && make clean && CC=gcc make -s
echo "### CLANG BUILD ###" && make clean && CC=clang make -s
@ -42,6 +45,7 @@ jobs:
- uses: actions/checkout@v2
- name: dep
run: |
sudo apt-get update
sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
gcc clang
sudo apt-get remove libxft2 libxft-dev libexif12 libexif-dev
@ -53,12 +57,14 @@ jobs:
# vanilla flags
CFLAGS="-std=c99 -Wall -pedantic"
# extra flags
CFLAGS+=" -O3 -flto"
CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
# silence
CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
export CFLAGS
export LDFLAGS="$CFLAGS"
export OPT_DEP_DEFAULT=0
echo "### GCC BUILD ###" && make clean && CC=gcc make -s
echo "### CLANG BUILD ###" && make clean && CC=clang make -s