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:
Pavel Roskin
2016-06-21 16:30:17 -07:00
parent 951e632757
commit a680d46edf
3 changed files with 142 additions and 0 deletions
+1
View File
@@ -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