Use -Wwrite-strings compiler flag if supported, add required macros
String literals are const in C++. Using this warnings moves us closer to the stated goal of C++ compatibility, makes the code cleaner and lets compilers optimize the code better. Add m4/ax_append_compile_flags.m4 from Autoconf Archives for the AX_APPEND_COMPILE_FLAGS macro and m4/ax_check_compile_flag.m4 as its dependency.
This commit is contained in:
@@ -14,6 +14,7 @@ PKG_PROG_PKG_CONFIG
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
AX_CFLAGS_WARN_ALL
|
||||
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
|
||||
AX_GCC_FUNC_ATTRIBUTE([format])
|
||||
|
||||
case $host_os in
|
||||
|
||||
Reference in New Issue
Block a user