Skip to content

Commit d6f19af

Browse files
committed
Remove default compiler flag
1 parent e4b8795 commit d6f19af

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CC1_BE_DIR:=$(CC1_DIR)/backend
3636
OPTIMIZE:=-O2 -g3
3737
CFLAGS:=-ansi -std=c11 -pedantic -MMD -Wall -Wextra -Werror -Wold-style-definition \
3838
-Wno-missing-field-initializers -Wno-empty-body \
39-
-D_DEFAULT_SOURCE $(OPTIMIZE) -I$(UTIL_DIR)
39+
$(OPTIMIZE) -I$(UTIL_DIR)
4040
ifneq ("$(NO_FLONUM)","")
4141
CFLAGS+=-D__NO_FLONUM
4242
endif

tests/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CFLAGS:=-ansi -std=c11 -Wall -Wextra -Werror \
1212
-Wno-empty-body
1313
CFLAGS+=-Wno-char-subscripts # for RISC-V, suppress error on isXXXX(char)
1414
CFLAGS+=-I$(CC1_FE_DIR) -I$(UTIL_DIR)
15-
CFLAGS+=-D_POSIX_C_SOURCE=200809L # for getline
1615

1716
PREFIX:=
1817
XCC:=../$(PREFIX)xcc
@@ -115,7 +114,7 @@ INITIALIZER_SRCS:=initializer_test.c $(CC1_FE_DIR)/parser.c $(CC1_FE_DIR)/parser
115114
$(UTIL_DIR)/util.c $(UTIL_DIR)/table.c \
116115
$(DEBUG_DIR)/dump_expr.c
117116
initializer_test: $(INITIALIZER_SRCS)
118-
$(CC) -o$@ -DNO_MAIN_DUMP_EXPR $(CFLAGS) $^
117+
$(CC) -o$@ -DNO_MAIN_DUMP_EXPR -D_DEFAULT_SOURCE $(CFLAGS) $^
119118

120119
TABLE_SRCS:=table_test.c $(UTIL_DIR)/table.c
121120
table_test: $(TABLE_SRCS)
@@ -130,7 +129,7 @@ PARSER_SRCS:=parser_test.c $(CC1_FE_DIR)/parser_expr.c $(CC1_FE_DIR)/parser.c \
130129
$(CC1_FE_DIR)/initializer.c $(CC1_FE_DIR)/fe_misc.c $(CC1_FE_DIR)/type.c $(CC1_FE_DIR)/ast.c \
131130
$(UTIL_DIR)/util.c $(UTIL_DIR)/table.c
132131
parser_test: $(PARSER_SRCS)
133-
$(CC) -o$@ $(CFLAGS) $^
132+
$(CC) -o$@ $(CFLAGS) -D_DEFAULT_SOURCE $^
134133

135134
VAL_SRCS:=valtest.c
136135
valtest: $(VAL_SRCS) # $(XCC)
@@ -144,7 +143,7 @@ fvaltest: $(FVAL_SRCS) flotest.inc # $(XCC)
144143

145144
TYPE_SRCS:=print_type_test.c $(CC1_FE_DIR)/type.c $(UTIL_DIR)/util.c $(UTIL_DIR)/table.c
146145
print_type_test: $(TYPE_SRCS)
147-
$(CC) -o $@ $(CFLAGS) $^
146+
$(CC) -o $@ $(CFLAGS) -D_DEFAULT_SOURCE $^
148147

149148
link_test: link_main.c link_sub.c
150149
$(XCC) -c -fcommon -olink_main.o -Wall -Werror link_main.c

0 commit comments

Comments
 (0)