From f52608c93adcfb7732fbf4caab1aa0b80a83fe30 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Feb 2017 13:03:21 -0600 Subject: build,all: enable -Wtype-limits and fix some comparisons -Wtype-limits warns when comparing unsigned variables <= 0, which we shouldn't be doing. --- m4/compiler-warnings.m4 | 2 +- src/libqmi-glib/qmi-device.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/compiler-warnings.m4 b/m4/compiler-warnings.m4 index de4a8b0..5ba490c 100644 --- a/m4/compiler-warnings.m4 +++ b/m4/compiler-warnings.m4 @@ -15,7 +15,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then -Wundef -Wimplicit-function-declaration \ -Wpointer-arith -Winit-self -Wshadow \ -Wmissing-include-dirs -Waggregate-return \ - -Wformat-security; do + -Wformat-security -Wtype-limits; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index 54096ca..1d8890e 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -1743,7 +1743,7 @@ parse_response (QmiDevice *self) if (qmi_utils_get_traces_enabled ()) { gchar *printable; - guint len = CLAMP (self->priv->buffer->len, 0, 2048); + guint len = MIN (self->priv->buffer->len, 2048); printable = __qmi_utils_str_hex (self->priv->buffer->data, len, ':'); g_debug ("<<<<<< RAW INVALID MESSAGE:\n" -- cgit v1.1