Last active
December 9, 2017 20:18
-
-
Save joekir/25bd2c4e67aeb4836107575133c5cfc1 to your computer and use it in GitHub Desktop.
A script that uses all available gcc flags to catch security issues when compiling c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.SILENT: | |
FILES = main.c | |
OUT_BIN = out | |
build: $(FILES) | |
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html | |
gcc -Werror=all -Werror=conversion -Werror=stack-protector \ | |
-Werror=pointer-sign -Werror=cast-align -Werror=cast-qual \ | |
-Wextra -Werror=format-security -Wfatal-errors -o $(OUT_BIN) $(FILES) | |
clean: | |
rm $(OUT_BIN) | |
rebuild: clean build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment