-/* Copyright (C) 1996-2013 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2022 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Written by Ulrich Drepper, <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _WEIGHT_H_
+#define _WEIGHT_H_ 1
+
+#include <libc-diag.h>
/* Find index of weight. */
-auto inline int32_t
-__attribute ((always_inline))
-findidx (const unsigned char **cpp, size_t len)
+static inline int32_t __attribute__ ((always_inline))
+findidx (const int32_t *table,
+ const int32_t *indirect,
+ const unsigned char *extra,
+ const unsigned char **cpp, size_t len)
{
int_fast32_t i = table[*(*cpp)++];
const unsigned char *cp;
already. */
size_t cnt;
+ /* With GCC 5.3 when compiling with -Os the compiler warns
+ that seq2.back_us, which becomes usrc, might be used
+ uninitialized. This can't be true because we pass a length
+ of -1 for len at the same time which means that this loop
+ never executes. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
+ DIAG_POP_NEEDS_COMMENT;
if (cnt == nhere)
{
do
{
offset <<= 8;
+ /* With GCC 7 when compiling with -Os the compiler
+ warns that seq1.back_us and seq2.back_us, which
+ become usrc, might be used uninitialized. This
+ is impossible for the same reason as described
+ above. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
offset += usrc[cnt] - cp[cnt];
+ DIAG_POP_NEEDS_COMMENT;
}
while (++cnt < nhere);
}
/* NOTREACHED */
return 0x43219876;
}
+
+#endif /* weight.h */