Add -Wwrite-strings and fix warnings.

Need to be const-clean when handling string literals.
This commit is contained in:
Carl Worth 2009-10-25 15:55:23 -07:00
parent 884ac59256
commit eb7b8cf31a
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
PROGS=notmuch PROGS=notmuch
CXXWARNINGS_FLAGS=-Wall -Wextra CXXWARNINGS_FLAGS=-Wall -Wextra -Wwrite-strings
CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS) CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS)
CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc`

6
date.c
View file

@ -79,7 +79,7 @@ static unsigned char gmime_datetok_table[256] = {
/* hrm, is there a library for this stuff? */ /* hrm, is there a library for this stuff? */
static struct { static struct {
char *name; const char *name;
int offset; int offset;
} tz_offsets [] = { } tz_offsets [] = {
{ "UT", 0 }, { "UT", 0 },
@ -99,12 +99,12 @@ static struct {
{ "Y", 1200 }, { "Y", 1200 },
}; };
static char *tm_months[] = { static const char *tm_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}; };
static char *tm_days[] = { static const char *tm_days[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
}; };