AC_PROG_CC_STDC
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
- -pipe \
-Wall \
- -Wextra \
- -Wno-inline \
- -Wundef \
- "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
- -Wno-unused-parameter \
- -Wno-unused-result \
- -fno-strict-aliasing \
- -ffunction-sections \
- -fdata-sections \
- -fstack-protector-all \
- --param=ssp-buffer-size=4])
+ -Wchar-subscripts \
+ -Wformat-security \
+ -Wmissing-declarations \
+ -Wmissing-prototypes \
+ -Wnested-externs \
+ -Wpointer-arith \
+ -Wshadow \
+ -Wsign-compare \
+ -Wstrict-prototypes \
+ -Wtype-limits \
+])
# Enable -fanalyzer if requested
AC_ARG_ENABLE([analyzer],
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fanalyzer])
)
-AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
- -Wp,-D_FORTIFY_SOURCE=2])],
- [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
-
-CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
- -Wl,--as-needed \
- -Wl,--no-undefined \
- -Wl,--gc-sections \
- -Wl,-z,relro \
- -Wl,-z,now])
-
# Enable -fno-semantic-interposition (if available)
CC_CHECK_FLAGS_APPEND([with_CFLAGS], [CFLAGS], [-fno-semantic-interposition])
CC_CHECK_FLAGS_APPEND([with_LDFLAGS], [LDFLAGS], [-fno-semantic-interposition])