Reverted to default standard to -ansi. Fixed warnings under compilation against -ansi. Code now builds and tests successfully under -std=c11 and -ansi on both clang (600.0.51) and gcc (4.9.1).

This commit is contained in:
Dalton Woodard
2014-10-15 16:23:59 -07:00
parent bae8dd5d82
commit 6efe026b25
2 changed files with 18 additions and 19 deletions

View File

@@ -1,11 +1,15 @@
# change notes:
# filter out -Werror when compiling ptest. GCC chooses to warn about strange things sometimes.
# mpc.c and mpc.h ompile will all flags below on clang and gcc with -Werror.
# added standard flag (and reverted to -ansi, can now be changed from command line `make -STD=...`
# to compile against various standards.
CC = gcc
CFLAGS = -std=c11 -O3 -g -Werror -Wall -Wextra -Wformat=2 -Wshadow \
-Wno-format-nonliteral -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs -Wswitch-default
STND=-ansi
CFLAGS = $(STND) -pedantic -O3 -g -Werror -Wall -Wextra -Wformat=2 -Wshadow -Wno-long-long \
-Wno-overlength-strings -Wno-format-nonliteral -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wredundant-decls -Wnested-externs \
-Wmissing-include-dirs -Wswitch-default
TESTS = $(wildcard tests/*.c)
EXAMPLES = $(wildcard examples/*.c)