-Wstringop-overread default
-Wstringop-truncation default
-Wsubobject-linkage c++ and objc++
--Wsuggest-attribute=returns_nonnull https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114833
+-Wsuggest-attribute=returns_nonnull https://gcc.gnu.org/PR114833
-Wsuggest-override c++ and objc++
-Wsurprising fortran
-Wswitch enabled by -Wall
@item
Some platforms define @code{nullptr_t} even when @code{<stddef.h>} is
not included:
-@c https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
+@c https://gcc.gnu.org/PR114869
GCC 14
@item
#endif
/* Work around AddressSanitizer bug.
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104262
+ https://gcc.gnu.org/PR104262
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20220124/1001910.html
*/
#ifdef __SANITIZE_ADDRESS__
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN_1(func,namespace) \
_GL_CXXALIASWARN_2 (func, namespace)
-/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+/* To work around GCC bug <https://gcc.gnu.org/PR43881>,
we enable the warning only when not optimizing. */
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
# define _GL_CXXALIASWARN_2(func,namespace) \
GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
-/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+/* To work around GCC bug <https://gcc.gnu.org/PR43881>,
we enable the warning only when not optimizing. */
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
If GCC_LINT is defined, do not inline this function with GCC 10.1
and later, to avoid creating a pointer to the stack that GCC
-Wreturn-local-addr incorrectly complains about. See:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+ https://gcc.gnu.org/PR93644
Although the noinline attribute can hurt performance a bit, no better way
to pacify GCC is known; even an explicit #pragma does not pacify GCC.
When the GCC bug is fixed this workaround should be limited to the
shrinking realloc. */
#ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
#warning "GCC might issue a bogus -Wreturn-local-addr warning here."
- #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+ #warning "See <https://gcc.gnu.org/PR93644>."
#endif
char stack_buf[STACK_BUF_SIZE];
return readlink_stk (fd, filename, buffer, buffer_size, alloc,
which represents 0x1.fffffffffffff7ffffffffffff8p+1023L.
Although computations can yield representations of numbers larger than this,
these computations are considered to have overflowed and behavior is undefined.
- See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120993>. */
+ See <https://gcc.gnu.org/PR120993>. */
# undef LDBL_MAX
# define LDBL_MAX 0x1.fffffffffffff7ffffffffffff8p+1023L
# define FLT_NORM_MAX FLT_MAX
#endif
#ifndef FLT_SNAN
-/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+/* For sh, beware of <https://gcc.gnu.org/PR111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define FLT_SNAN __builtin_nansf ("")
# else
# define DBL_NORM_MAX DBL_MAX
#endif
#ifndef DBL_SNAN
-/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+/* For sh, beware of <https://gcc.gnu.org/PR111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define DBL_SNAN __builtin_nans ("")
# else
# endif
#endif
#ifndef LDBL_SNAN
-/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+/* For sh, beware of <https://gcc.gnu.org/PR111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define LDBL_SNAN __builtin_nansl ("")
# else
{
# if defined __GNUC__ && !defined __clang__
/* An invalid GCC optimization
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396>
+ <https://gcc.gnu.org/PR98396>
would optimize away the assignments in the code below, when link-time
optimization (LTO) is enabled. Make the code more complicated, so that
GCC does not grok how to optimize it. */
#elif defined __has_builtin
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
- see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
+ see <https://gcc.gnu.org/PR98269>. */
#elif 7 <= __GNUC__
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
#else
#endif
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://gcc.gnu.org/PR68193
https://llvm.org/bugs/show_bug.cgi?id=25390
For now, assume GCC < 14 and all Clang versions generate bogus
warnings for _Generic. This matters only for compilers that
undefined behavior even though C17 and earlier partially defined
the behavior. Let the programmer know.
When the undefined-behaviour sanitizers report this case, i.e. when
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117233> and
+ <https://gcc.gnu.org/PR117233> and
<https://github.com/llvm/llvm-project/issues/113065>
have been closed and new releases of GCC and clang have been made,
we can revisit this code. */
#include "attribute.h"
#include "xalloc.h"
-/* Pacify GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113963>. */
+/* Pacify GCC bug <https://gcc.gnu.org/PR113963>. */
#if _GL_GNUC_PREREQ (13, 0)
# pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
# pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
positive_NaNf ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
float volatile nan = NaNf ();
return (signbit (nan) ? minus_NaNf (nan) : nan);
}
negative_NaNf ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
float volatile nan = NaNf ();
return (signbit (nan) ? nan : minus_NaNf (nan));
}
positive_NaNd ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
double volatile nan = NaNd ();
return (signbit (nan) ? minus_NaNd (nan) : nan);
}
negative_NaNd ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
double volatile nan = NaNd ();
return (signbit (nan) ? nan : minus_NaNd (nan));
}
positive_NaNl ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
long double volatile nan = NaNl ();
return (signbit (nan) ? minus_NaNl (nan) : nan);
}
negative_NaNl ()
{
/* 'volatile' works around a GCC bug:
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655> */
+ <https://gcc.gnu.org/PR111655> */
long double volatile nan = NaNl ();
return (signbit (nan) ? nan : minus_NaNl (nan));
}
|| defined __need_wint_t) \
/* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \
in GCC 13.3 and 14.2 \
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \
+ <https://gcc.gnu.org/PR114870>. */ \
&& !@STDDEF_NOT_IDEMPOTENT@
/* Special invocation convention inside gcc header files. In
particular, <stddef.h> in some ancient versions of GCC blindly
# if !defined _GCC_NULLPTR_T && !@NULLPTR_T_NEEDS_STDDEF@
/* Suppress unwanted nullptr_t typedef. See
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869>. */
+ <https://gcc.gnu.org/PR114869>. */
# define _GCC_NULLPTR_T
# endif
/* Avoid false GCC warning "'memset' specified size 18446744073709551615 exceeds
maximum object size 9223372036854775807", caused by insufficient data flow
analysis and value propagation of the 'width_add' expansion when GCC is not
- optimizing. Cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443>. */
+ optimizing. Cf. <https://gcc.gnu.org/PR88443>. */
#if _GL_GNUC_PREREQ (7, 0) && !__OPTIMIZE__
# pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
# if defined __cplusplus && defined __GNUC__ && !defined __clang__
-/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+/* Work around GCC bug <https://gcc.gnu.org/PR108231> */
# define _GL_ATTRIBUTE_DEALLOC_FREE \
_GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
# else
# if defined __GNUC__ || defined __clang__
/* Prevent gcc and clang from reusing the values of *x and *y (fetched above)
in optimized inlined memcpy expansions.
- Seen with gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659>
+ Seen with gcc <https://gcc.gnu.org/PR114659>
and with clang 16.0.6 on OpenBSD 7.5. */
__asm__ __volatile__ ("" : : : "memory");
# endif
# if defined __GNUC__ || defined __clang__
/* Prevent gcc and clang from reusing the values of *x and *y (fetched above)
in optimized inlined memcpy expansions.
- Seen with gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659>
+ Seen with gcc <https://gcc.gnu.org/PR114659>
and with clang 16.0.6 on OpenBSD 7.5. */
__asm__ __volatile__ ("" : : : "memory");
# endif
# if defined __GNUC__ || defined __clang__
/* Prevent gcc and clang from reusing the values of *x and *y (fetched above)
in optimized inlined memcpy expansions.
- Seen with gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659>
+ Seen with gcc <https://gcc.gnu.org/PR114659>
and with clang 16.0.6 on OpenBSD 7.5. */
__asm__ __volatile__ ("" : : : "memory");
# endif
# if defined __GNUC__ || defined __clang__
/* Prevent gcc and clang from reusing the values of *x and *y (fetched above)
in optimized inlined memcpy expansions.
- Seen with gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659>
+ Seen with gcc <https://gcc.gnu.org/PR114659>
and with clang 16.0.6 on OpenBSD 7.5. */
__asm__ __volatile__ ("" : : : "memory");
# endif
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
# if defined __cplusplus && defined __GNUC__ && !defined __clang__
-/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+/* Work around GCC bug <https://gcc.gnu.org/PR108231> */
# define _GL_ATTRIBUTE_DEALLOC_FREE \
_GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
# else
dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
dnl program below may lead to an endless loop. See
- dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+ dnl <https://gcc.gnu.org/PR42440>.
AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
AC_CHECK_FUNCS_ONCE([btowc])
suppress bogus "no previous prototype for 'FOO'"
and "no previous declaration for 'FOO'" diagnostics,
when FOO is an inline function in the header; see
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
+ <https://gcc.gnu.org/PR54113> and
+ <https://gcc.gnu.org/PR63877>. */
#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
# define _GL_INLINE_HEADER_CONST_PRAGMA
======================================================================
This gives a syntax error
- in C mode with gcc
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796>, and
+ <https://gcc.gnu.org/PR108796>, and
- in C++ mode with clang++ version < 16, and
- in C++ mode, inside extern "C" {}, still in newer clang++ versions
<https://github.com/llvm/llvm-project/issues/101990>.
yet. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
# if defined __cplusplus && defined __GNUC__ && !defined __clang__
-/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+/* Work around GCC bug <https://gcc.gnu.org/PR108231> */
# define _GL_ATTRIBUTE_DEALLOC_FREE \
_GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
# else
fi
# This warning have too many false alarms in GCC 11.2.1.
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101713
+ # https://gcc.gnu.org/PR101713
AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak'])
AC_LANG_POP([C])
[AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[int *p = nullptr;]])],
[gl_cv_c_nullptr=yes
- # Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114780>.
+ # Work around <https://gcc.gnu.org/PR114780>.
gl_saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wall -Werror"
AC_COMPILE_IFELSE(
/* Test that alignof yields a result consistent with offsetof.
This catches GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ <https://gcc.gnu.org/PR52023>. */
#ifdef __cplusplus
template <class t> struct alignof_helper { char a; t b; };
# define ao(type) offsetof (alignof_helper<type>, b)
want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ <https://gcc.gnu.org/PR52023>.
clang versions < 8.0.0 have the same bug.
IBM XL C V16.1.0 cc (non-clang) has the same bug. */
# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
dnl Provide gl_unreachable() unconditionally.
GL_GENERATE_STDDEF_H=true
- dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
+ dnl https://gcc.gnu.org/PR114869
AC_CACHE_CHECK([whether nullptr_t needs <stddef.h>],
[gl_cv_nullptr_t_needs_stddef],
[AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]],
GL_GENERATE_STDDEF_H=true
fi
- dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870
+ dnl https://gcc.gnu.org/PR114870
dnl affects GCC 13.3 and 14.2.
AC_CACHE_CHECK([whether <stddef.h> is idempotent],
[gl_cv_stddef_idempotent],
[
dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
dnl 'gnu_inline'. See <https://sourceware.org/PR4022>
- dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+ dnl and <https://gcc.gnu.org/PR42440>. In summary,
dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
AC_REQUIRE([AC_CANONICAL_HOST])
Makefile.am:
if LIBUNISTRING_COMPILE_UNINAME_UNINAME
# Note: Compilation of this file takes a long time with gcc ≥ 11 and option
-# -fanalyzer. See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110112>.
+# -fanalyzer. See <https://gcc.gnu.org/PR110112>.
# The best workaround is to install GNU libunistring first, and use module
# 'libunistring-optional' in your package.
# An alternative workaround would be to pass the option -fno-analyzer, using
/* This test works only if the canonicalize_file_name implementation
comes from gnulib. If it comes from libc, we have no way to prevent
gcc from "optimizing" the null_ptr function in invalid ways. See
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>. */
+ <https://gcc.gnu.org/PR93156>. */
#if GNULIB_defined_canonicalize_file_name
errno = 0;
result = canonicalize_file_name (null_ptr ());
/* This test works only if the canonicalize_file_name implementation
comes from gnulib. If it comes from libc, we have no way to prevent
gcc from "optimizing" the null_ptr function in invalid ways. See
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>. */
+ <https://gcc.gnu.org/PR93156>. */
#if GNULIB_defined_canonicalize_file_name
errno = 0;
result1 = canonicalize_file_name (null_ptr ());
# pragma GCC diagnostic ignored "-Wtype-limits"
/* Work around a bug in GCC 6.1 and earlier; see:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 */
+ https://gcc.gnu.org/PR68971 */
# pragma GCC diagnostic ignored "-Woverflow"
#endif
/* This test works only if the ptsname_r implementation comes from gnulib.
If it comes from libc, we have no way to prevent gcc from "optimizing"
the null_ptr function in invalid ways. See
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>. */
+ <https://gcc.gnu.org/PR93156>. */
#if GNULIB_defined_ptsname_r
result = ptsname_r (fd, null_ptr (), 0);
ASSERT (result != 0);
/* This test is known to fail
- on musl libc,
- with GCC 14.1, 13.2, 12.3, and 11.4
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114876> */
+ <https://gcc.gnu.org/PR114876> */
ASSERT (memcmp (result, "a\0z 33\0", 6 + 1) == 0);
ASSERT (retval == 6);
}