summaryrefslogtreecommitdiffstats
path: root/lib/canonicalize.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:55:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:55:47 +0000
commitcd10ccf4d1b4671883a0d45f6769947a6cdb45d0 (patch)
treeb14481899a2c6c4dd53beed82f0f61c6f77254d1 /lib/canonicalize.c
parentAdding upstream version 1.21.4. (diff)
downloadwget-upstream/1.24.5.tar.xz
wget-upstream/1.24.5.zip
Adding upstream version 1.24.5.upstream/1.24.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/canonicalize.c')
-rw-r--r--lib/canonicalize.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/canonicalize.c b/lib/canonicalize.c
index 010190d..52e9b3b 100644
--- a/lib/canonicalize.c
+++ b/lib/canonicalize.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2023 Free Software Foundation, Inc.
+ Copyright (C) 1996-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,13 +34,6 @@
#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
@@ -51,6 +44,11 @@
# 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
@@ -369,7 +367,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
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);