+2023-05-18 Bruno Haible <bruno@clisp.org>
+
+ canonicalize: Silence gcc warning.
+ * lib/canonicalize.c: Add #pragma GCC diagnostic.
+ (IF_LINT): Remove macro.
+ (canonicalize_filename_mode_stk): Remove use of IF_LINT.
+
2023-05-18 Bruno Haible <bruno@clisp.org>
vasnprintf, c-vasnprintf: Silence gcc warning.
#include "hash-triple.h"
#include "xalloc.h"
-/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */
-#if defined GCC_LINT || defined lint
-# define IF_LINT(Code) Code
-#else
-# define IF_LINT(Code) /* empty */
-#endif
-
#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
#endif
# define SLASHES "/"
#endif
+/* Avoid false GCC warning "'end_idx' may be used uninitialized". */
+#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+
/* Return true if FILE's existence can be shown, false (setting errno)
otherwise. Follow symbolic links. */
static bool
buf[n] = '\0';
char *extra_buf = bufs->extra.data;
- idx_t end_idx IF_LINT (= 0);
+ idx_t end_idx;
if (end_in_extra_buffer)
end_idx = end - extra_buf;
size_t len = strlen (end);