Subject: bug#66002: closed (Re: bug#66002: [PATCH] build: suppress suggest-attribute=cold warnings)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 14 Dec 2024 00:26:02 +0000

Your bug report

#66002: [PATCH] build: suppress suggest-attribute=cold warnings

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
66002: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66002
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#66002: [PATCH] build: suppress suggest-attribute=cold warnings
From: Paul Eggert <[email-masked]>
To: Gleb Fotengauer-Malinovskiy <[email-masked]>
Cc: [email-masked]
Date: Fri, 13 Dec 2024 17:25:24 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 9/16/23 15:28, Gleb Fotengauer-Malinovskiy wrote:
> I'm not insisting that this needs to be addressed, but I do believe that
> someone else might encounter this issue.

If it becomes a problem I suppose we could disable 
--suggest-attribute=cold, as it's not that useful for coreutils. In the 
meantime I'm closing this old bug report.

Subject: [PATCH] build: suppress suggest-attribute=cold warnings
From: Gleb Fotengauer-Malinovskiy <[email-masked]>
To: [email-masked]
Cc: Gleb Fotengauer-Malinovskiy <[email-masked]>
Date: Fri, 15 Sep 2023 13:45:00 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Following the glibc commit glibc-2.38~298 ("Mark various cold functions
as __COLD"), GNU grep build with -flto flag triggers a GCC warning:

sigsegv.c: In function ‘stackoverflow_deinstall_handler.part.0’:
sigsegv.c:1441:1: error: function might be candidate for attribute ‘cold’ [-Werror=suggest-attribute=cold]

* configure.ac (GNULIB_WARN_CFLAGS): Suppress -Wsuggest-attribute=cold.

Tiny-change: yes
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 844a259bd..b793cabde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,6 +159,11 @@ if test $gl_gcc_warnings != no; then
   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
   nw=
   nw="$nw -Wunused-macros"
+
+  # To prevent warnings in sigsegv.c if the perror function
+  # has "cold" attribute.
+  nw="$nw -Wsuggest-attribute=cold"
+
   gl_WARN_ADD([-Wno-format-nonliteral])
   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
   AC_SUBST([GNULIB_WARN_CFLAGS])
-- 
glebfm