Add -Wextra and fix warnings.

When adding -Wextra we also add -Wno-ununsed-parameters since that
function means well enough, but is really annoying in practice.

So the warnings we fix here are basically all comparsions between
signed and unsigned values.
This commit is contained in:
Carl Worth 2009-10-25 15:39:53 -07:00
parent 067c547b23
commit cc48812cb5
4 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,7 @@
PROGS=notmuch PROGS=notmuch
CXXWARNINGS_FLAGS=-Wall CXXWARNINGS_FLAGS=-Wall -Wextra -Wno-unused-parameter
CWARNINGS_FLAGS=$(CXX_WARNINGS_FLAGS) CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS)
CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc`
CXXDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` `xapian-config --cxxflags` CXXDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` `xapian-config --cxxflags`

View file

@ -162,7 +162,7 @@ copy_header_unfolding (header_value_closure_t *value,
chunk++; chunk++;
if (value->len + 1 + strlen (chunk) + 1 > value->size) { if (value->len + 1 + strlen (chunk) + 1 > value->size) {
int new_size = value->size; unsigned int new_size = value->size;
if (value->size == 0) if (value->size == 0)
new_size = strlen (chunk) + 1; new_size = strlen (chunk) + 1;
else else

View file

@ -755,7 +755,8 @@ restore_command (int argc, char *argv[])
FILE *input; FILE *input;
notmuch_database_t *notmuch = NULL; notmuch_database_t *notmuch = NULL;
char *line = NULL; char *line = NULL;
size_t line_size, line_len; size_t line_size;
ssize_t line_len;
regex_t regex; regex_t regex;
int rerr; int rerr;
int ret = 0; int ret = 0;
@ -893,7 +894,7 @@ void
usage (void) usage (void)
{ {
command_t *command; command_t *command;
int i; unsigned int i;
fprintf (stderr, "Usage: notmuch <command> [args...]\n"); fprintf (stderr, "Usage: notmuch <command> [args...]\n");
fprintf (stderr, "\n"); fprintf (stderr, "\n");
@ -911,7 +912,7 @@ int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
command_t *command; command_t *command;
int i; unsigned int i;
if (argc == 1) if (argc == 1)
return setup_command (0, NULL); return setup_command (0, NULL);

View file

@ -113,7 +113,8 @@ int
xregexec (const regex_t *preg, const char *string, xregexec (const regex_t *preg, const char *string,
size_t nmatch, regmatch_t pmatch[], int eflags) size_t nmatch, regmatch_t pmatch[], int eflags)
{ {
int i, rerr; unsigned int i;
int rerr;
rerr = regexec (preg, string, nmatch, pmatch, eflags); rerr = regexec (preg, string, nmatch, pmatch, eflags);
if (rerr) if (rerr)