Added lots of extra compiler flags

This commit is contained in:
Bruce Hill 2021-05-31 13:25:38 -07:00
parent a67a257044
commit c89fd1db42
2 changed files with 15 additions and 3 deletions

View File

@ -3,7 +3,19 @@ CC=cc
PREFIX=/usr/local
SYSCONFDIR=/etc
CFLAGS=-std=c99 -Werror -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -flto
CWARN=-Wall -Wpedantic -Wextra -Wsign-conversion -Wtype-limits -Wunused-result -Wnull-dereference
CWARN=-Wall -Wpedantic -Wextra \
-Wsign-conversion -Wtype-limits -Wunused-result -Wnull-dereference \
-Waggregate-return -Walloc-zero -Walloca -Warith-conversion -Wcast-align -Wcast-align=strict \
-Wdangling-else -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches \
-Wduplicated-cond -Wexpansion-to-defined -Wfloat-conversion -Wfloat-equal -Wformat-nonliteral \
-Wformat-security -Wformat-signedness -Wframe-address -Winline -Winvalid-pch -Wjump-misses-init \
-Wlogical-op -Wlong-long -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn \
-Wnull-dereference -Woverlength-strings -Wpacked -Wpacked-not-aligned -Wpointer-arith \
-Wredundant-decls -Wshadow -Wshadow=compatible-local -Wshadow=global -Wshadow=local \
-Wsign-conversion -Wstack-protector -Wsuggest-attribute=const -Wswitch-default -Wswitch-enum \
-Wsync-nand -Wtrampolines -Wundef -Wunsuffixed-float-constants -Wunused -Wunused-but-set-variable \
-Wunused-const-variable -Wunused-local-typedefs -Wunused-macros -Wvariadic-macros -Wvector-operation-performance \
-Wvla -Wwrite-strings
EXTRA=
G=
O=-O3

4
bp.c
View File

@ -451,7 +451,7 @@ static int process_git_files(def_t *defs, pat_t *pattern, int argc, char *argv[]
if (child == -1)
err(EXIT_FAILURE, "Failed to fork");
if (child == 0) {
char **git_args = memcheck(calloc((size_t)(2+argc+1), sizeof(char*)));
const char **git_args = memcheck(calloc((size_t)(2+argc+1), sizeof(char*)));
int g = 0;
git_args[g++] = "git";
git_args[g++] = "ls-files";
@ -460,7 +460,7 @@ static int process_git_files(def_t *defs, pat_t *pattern, int argc, char *argv[]
err(EXIT_FAILURE, "Failed to hook up pipe to stdout");
if (close(fds[STDIN_FILENO]) != 0)
err(EXIT_FAILURE, "Failed to close read end of pipe");
(void)execvp("git", git_args);
(void)execvp("git", (char**)git_args);
_exit(EXIT_FAILURE);
}
if (close(fds[STDOUT_FILENO]) != 0)