From eb7b8cf31a8378784e97966204559f1b270ac3e9 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 25 Oct 2009 15:55:23 -0700 Subject: [PATCH] Add -Wwrite-strings and fix warnings. Need to be const-clean when handling string literals. --- Makefile | 2 +- date.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6e3ab26d..b2d5924b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROGS=notmuch -CXXWARNINGS_FLAGS=-Wall -Wextra +CXXWARNINGS_FLAGS=-Wall -Wextra -Wwrite-strings CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS) CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` diff --git a/date.c b/date.c index c116bbd5..44f5a99a 100644 --- a/date.c +++ b/date.c @@ -79,7 +79,7 @@ static unsigned char gmime_datetok_table[256] = { /* hrm, is there a library for this stuff? */ static struct { - char *name; + const char *name; int offset; } tz_offsets [] = { { "UT", 0 }, @@ -99,12 +99,12 @@ static struct { { "Y", 1200 }, }; -static char *tm_months[] = { +static const char *tm_months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -static char *tm_days[] = { +static const char *tm_days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -- 2.43.0