From 3cf4fc5e816cdda1ae2108987b9558ea6968b9e9 Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Sun, 20 Feb 2022 07:55:17 +0000 Subject: 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. --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67cd347..e675de2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 -- cgit v1.2.3