GITINFO != git describe --always
.endif
-CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes
-
.if $(CC) == clang
CFLAGS += -Weverything\
-Wno-padded\
CYGWIN = $(findstring CYGWIN, $(UNAME))
MINGW = $(findstring MINGW, $(UNAME))
-CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes -O3
-#turn on tons of warnings if clang is present
+# turn on tons of warnings if clang is present
# but also turn off the STUPID ONES
ifeq ($(CC), clang)
CFLAGS += \
}
}
-void prog_disasm_function(qc_program_t *prog, size_t id);
+static void prog_disasm_function(qc_program_t *prog, size_t id);
int main(int argc, char **argv) {
size_t i;
return 0;
}
-void prog_disasm_function(qc_program_t *prog, size_t id) {
+static void prog_disasm_function(qc_program_t *prog, size_t id) {
prog_section_function_t *fdef = prog->functions + id;
prog_section_statement_t *st;
DATADIR := $(PREFIX)/share
MANDIR := $(DATADIR)/man
+# default flags
+CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes -O2
+
# compiler
CC ?= clang
-observertrans \
-abstract \
-statictrans \
- -castfcnptr
+ -castfcnptr \
+ -shiftimplementation \
+ -shiftnegative \
+ -boolcompare \
+ -infloops \
+ -sysunrecog
#always the right rule
default: all
#style rule
STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \)
+# splint cannot parse the MSVC source
+SPLINT_MATCH = \( -name '*.[ch]' -and ! -name 'msvc.c' -and ! -path './doc/*' \)
+
style:
find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/ /g' '{}' ';'
splint:
- @splint $(SPLINTFLAGS) *.c *.h
+ @splint $(SPLINTFLAGS) `find . -type f $(SPLINT_MATCH)`
gource:
@gource $(GOURCEFLAGS)