Hi, the attached trivial patch allows to compile with -Wtype-limits -Wempty-body (or -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers).
As the two fixes seem harmless, that seems to be a good idea. And the recent "bug" (its not really that, but ...) in walsender.c shows that at least -Wtype-limits is a sensible warning. Independently from this patch, should we add -Wtype-limits to the default parameters? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index f2cf5c6..263fe5a 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -331,8 +331,8 @@ PROCLOCK_PRINT(const char *where, const PROCLOCK *proclockP) } #else /* not LOCK_DEBUG */ -#define LOCK_PRINT(where, lock, type) -#define PROCLOCK_PRINT(where, proclockP) +#define LOCK_PRINT(where, lock, type) (void)0 +#define PROCLOCK_PRINT(where, proclockP) (void)0 #endif /* not LOCK_DEBUG */ diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c index cb2f8eb..d8c6be5 100644 --- a/src/backend/tsearch/wparser_def.c +++ b/src/backend/tsearch/wparser_def.c @@ -1811,7 +1811,7 @@ TParserGet(TParser *prs) pg_mblen(prs->str + prs->state->posbyte); Assert(prs->state->posbyte + prs->state->charlen <= prs->lenstr); - Assert(prs->state->state >= TPS_Base && prs->state->state < TPS_Null); + Assert(prs->state->state < TPS_Null); Assert(Actions[prs->state->state].state == prs->state->state); if (prs->state->pushedAtAction)
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers