Fix build with older GCCs
[collectd.git] / src / liboconfig / scanner.l
index 41d6643..2b5dbfb 100644 (file)
 #include "aux_types.h"
 #include "parser.h"
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wmissing-noreturn"
+#endif
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsign-compare"
+
 /* multiline string buffer */
 static char *ml_buffer = NULL;
 static int   ml_pos    = 0;
@@ -146,7 +154,7 @@ static void ml_append (char *string)
 
        if (ml_free <= len) {
                ml_len += len - ml_free + 1;
-               ml_buffer = (char *)realloc (ml_buffer, ml_len);
+               ml_buffer = realloc (ml_buffer, ml_len);
                if (NULL == ml_buffer)
                        YY_FATAL_ERROR ("out of dynamic memory in ml_append");
        }
@@ -159,3 +167,8 @@ static void ml_append (char *string)
        return;
 } /* ml_append */
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#pragma GCC diagnostic pop