enable some warnings & fix 'em

This commit is contained in:
Steffen Jaeckel
2017-06-29 15:16:43 +02:00
parent 4c504ee42b
commit c074a6166c
5 changed files with 6 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ SSL_LIBS = @openssl_LIBS@
RESOLV_LIBS = @RESOLV_LIBS@ RESOLV_LIBS = @RESOLV_LIBS@
STROPHE_FLAGS = -I$(top_srcdir) STROPHE_FLAGS = -I$(top_srcdir) -Wall -Wextra -Werror -Wno-unused-parameter
STROPHE_LIBS = libstrophe.la STROPHE_LIBS = libstrophe.la
## Main build targets ## Main build targets

View File

@@ -131,7 +131,7 @@ static vcard_cb_t vcard_cb_get(xmpp_stanza_t *stanza)
{ {
vcard_cb_t cb = NULL; vcard_cb_t cb = NULL;
const char *tag; const char *tag;
int i; size_t i;
static struct { static struct {
const char *tag; const char *tag;

View File

@@ -431,7 +431,7 @@ int xmpp_stanza_to_text(xmpp_stanza_t *stanza,
ret = _render_stanza_recursive(stanza, buffer, length); ret = _render_stanza_recursive(stanza, buffer, length);
if (ret < 0) return ret; if (ret < 0) return ret;
if (ret > length - 1) { if ((size_t)ret > length - 1) {
tmp = xmpp_realloc(stanza->ctx, buffer, ret + 1); tmp = xmpp_realloc(stanza->ctx, buffer, ret + 1);
if (!tmp) { if (!tmp) {
xmpp_free(stanza->ctx, buffer); xmpp_free(stanza->ctx, buffer);
@@ -443,7 +443,7 @@ int xmpp_stanza_to_text(xmpp_stanza_t *stanza,
buffer = tmp; buffer = tmp;
ret = _render_stanza_recursive(stanza, buffer, length); ret = _render_stanza_recursive(stanza, buffer, length);
if (ret > length - 1) return XMPP_EMEM; if ((size_t)ret > length - 1) return XMPP_EMEM;
} }
buffer[length - 1] = 0; buffer[length - 1] = 0;

View File

@@ -134,8 +134,7 @@ int main(int argc, char *argv[])
unsigned char *udec; unsigned char *udec;
char *dec; char *dec;
char *enc; char *enc;
size_t len; size_t len, i;
int i;
printf("BASE64 tests.\n"); printf("BASE64 tests.\n");

View File

@@ -79,7 +79,7 @@ static int test_strdup_one(xmpp_ctx_t *ctx, const char *s)
static int test_strdup(void) static int test_strdup(void)
{ {
xmpp_ctx_t *ctx; xmpp_ctx_t *ctx;
int i; size_t i;
int rc = 0; int rc = 0;
static const char *tests[] = { "", "\0", "test", "s p a c e", "\n\r" }; static const char *tests[] = { "", "\0", "test", "s p a c e", "\n\r" };