summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjcb <djcb@djcbsoftware.nl>2018-06-11 10:49:07 +0300
committerdjcb <djcb@djcbsoftware.nl>2018-06-11 10:49:07 +0300
commit99df588d41afcea6b501c348e1578f7b81eb565c (patch)
treedaae4954d96a314320e45758b8dcab43c0074640
parentdcaad0e4734161d71548f53c977ce534e6b0d067 (diff)
update compiler warnings, fix them
Update the compiler warnings, and fix all the ones outside the guile/.
-rw-r--r--configure.ac7
-rw-r--r--guile/Makefile.am4
-rw-r--r--mu/tests/Makefile.am6
-rw-r--r--mu/tests/test-mu-cmd-cfind.c30
4 files changed, 25 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index f64e25f..96693d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,13 @@ AC_PROG_CC_C99
AC_PROG_INSTALL
AC_HEADER_STDC
+extra_flags="-Wformat-security \
+ -Wstack-protector \
+ -Wstack-protector-all \
+ -Wno-cast-function-type"
+
AX_CXX_COMPILE_STDCXX_14
-m4_ifdef([AX_COMPILER_FLAGS],[AX_COMPILER_FLAGS(,,[yes])])
+m4_ifdef([AX_COMPILER_FLAGS],[AX_COMPILER_FLAGS(,,[yes],${extra_flags})])
AX_VALGRIND_CHECK
# for now, use AM_PROG_LIBTOOL, as we don't want to require
diff --git a/guile/Makefile.am b/guile/Makefile.am
index e63c1b0..15ca95c 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -28,8 +28,8 @@ AM_CPPFLAGS= \
# don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not
# really need all the params they get
-AM_CFLAGS=-Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement
-AM_CXXFLAGS=-Wall -Wextra -Wno-unused-parameter
+AM_CFLAGS=${WARN_CFLAGS}
+AM_CXXFLAGS=${WARN_CXXFLAGS}
lib_LTLIBRARIES= \
libguile-mu.la
diff --git a/mu/tests/Makefile.am b/mu/tests/Makefile.am
index 818f59f..565f470 100644
--- a/mu/tests/Makefile.am
+++ b/mu/tests/Makefile.am
@@ -33,8 +33,8 @@ AM_CPPFLAGS=$(XAPIAN_CXXFLAGS) \
# don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not
# really need all the params they get
-AM_CFLAGS=-Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement
-AM_CXXFLAGS=-Wall -Wextra -Wno-unused-parameter
+AM_CFLAGS=${WARN_CFLAGS}
+AM_CXXFLAGS=${WARN_CXXFLAGS}
noinst_PROGRAMS= $(TEST_PROGS)
@@ -59,7 +59,7 @@ test_mu_threads_SOURCES= test-mu-threads.c dummy.cc
test_mu_threads_LDADD=${top_builddir}/lib/tests/libtestmucommon.la
# we need to use dummy.cc to enforce c++ linking...
-BUILT_SOURCES= \
+BUILT_SOURCES= \
dummy.cc
dummy.cc:
touch dummy.cc
diff --git a/mu/tests/test-mu-cmd-cfind.c b/mu/tests/test-mu-cmd-cfind.c
index 383234d..5231fda 100644
--- a/mu/tests/test-mu-cmd-cfind.c
+++ b/mu/tests/test-mu-cmd-cfind.c
@@ -98,8 +98,6 @@ test_mu_cfind_bbdb (void)
{
gchar *cmdline, *output, *erroutput, *expected;
gchar today[12];
- const char* frm1;
- const char *frm2;
struct tm *tmtoday;
time_t now;
const char *old_tz;
@@ -114,24 +112,24 @@ test_mu_cfind_bbdb (void)
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
NULL, NULL));
- frm1 = ";; -*-coding: utf-8-emacs;-*-\n"
- ";;; file-version: 6\n"
- "[\"Helmut\" \"Kröger\" nil nil nil nil (\"hk@testmu.xxx\") "
- "((creation-date . \"%s\") "
+#define frm1 ";; -*-coding: utf-8-emacs;-*-\n" \
+ ";;; file-version: 6\n" \
+ "[\"Helmut\" \"Kröger\" nil nil nil nil (\"hk@testmu.xxx\") " \
+ "((creation-date . \"%s\") " \
+ "(time-stamp . \"1970-01-01\")) nil]\n" \
+ "[\"Mü\" \"\" nil nil nil nil (\"testmu@testmu.xx\") " \
+ "((creation-date . \"%s\") " \
"(time-stamp . \"1970-01-01\")) nil]\n"
- "[\"Mü\" \"\" nil nil nil nil (\"testmu@testmu.xx\") "
- "((creation-date . \"%s\") "
- "(time-stamp . \"1970-01-01\")) nil]\n";
- frm2 = ";; -*-coding: utf-8-emacs;-*-\n"
- ";;; file-version: 6\n"
- "[\"Mü\" \"\" nil nil nil nil (\"testmu@testmu.xx\") "
- "((creation-date . \"%s\") "
+#define frm2 ";; -*-coding: utf-8-emacs;-*-\n" \
+ ";;; file-version: 6\n" \
+ "[\"Mü\" \"\" nil nil nil nil (\"testmu@testmu.xx\") " \
+ "((creation-date . \"%s\") " \
+ "(time-stamp . \"1970-01-01\")) nil]\n" \
+ "[\"Helmut\" \"Kröger\" nil nil nil nil (\"hk@testmu.xxx\") " \
+ "((creation-date . \"%s\") " \
"(time-stamp . \"1970-01-01\")) nil]\n"
- "[\"Helmut\" \"Kröger\" nil nil nil nil (\"hk@testmu.xxx\") "
- "((creation-date . \"%s\") "
- "(time-stamp . \"1970-01-01\")) nil]\n";
g_assert (output);