Subject: bug#44535: closed (Re: bug#44535: grep-3.6 released [stable])

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 22 Nov 2020 02:16:02 +0000

Your bug report

#44535: grep-3.6 released [stable]

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].

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

Subject: Re: bug#44535: grep-3.6 released [stable]
From: Paul Eggert <[email-masked]>
To: Andreas Schwab <[email-masked]>
Cc: Gnulib bugs <[email-masked]>, [email-masked]
Date: Sat, 21 Nov 2020 18:15:20 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 11/12/20 11:39 PM, Paul Eggert wrote:
> We have dueling compilers here, as Sun C complains if the return statements are 
> present[1], whereas gcc -Wreturn-type complains if they're absent. Since the 
> return statements are clearly bogus and unnecessary I'm inclined to continue to 
> omit them.

I looked into this some more, and found out that it's a known GCC bug. I 
installed the attached patch into Gnulib to work around the bug. Thanks for 
reporting the problem.
>From f60dd0747ad75c2971cc314111c8fc2b8a38ce19 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 21 Nov 2020 18:09:29 -0800
Subject: [PATCH] nl_langinfo-tests: work around GCC bug 44511

* tests/test-nl_langinfo-mt.c: Ignore -Wreturn-type, to work
around a GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44511>.
Problem reported for GNU grep by Andreas Schwab
<https://bugs.gnu.org/44535>.
---
 ChangeLog                   | 6 ++++++
 tests/test-nl_langinfo-mt.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 745a90097..d46bfbb1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2020-11-21  Paul Eggert  <[email-masked]>
 
+	nl_langinfo-tests: work around GCC bug 44511
+	* tests/test-nl_langinfo-mt.c: Ignore -Wreturn-type, to work
+	around a GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44511>.
+	Problem reported for GNU grep by Andreas Schwab
+	<https://bugs.gnu.org/44535>.
+
 	selinux-h: add stubs for selabel_open etc.
 	Coreutils with --enable-gcc-warnings does not build on Ubuntu 20.10
 	because matchpathcon is deprecated in favor of selabel_open etc.,
diff --git a/tests/test-nl_langinfo-mt.c b/tests/test-nl_langinfo-mt.c
index 4d207f1be..751008ff9 100644
--- a/tests/test-nl_langinfo-mt.c
+++ b/tests/test-nl_langinfo-mt.c
@@ -18,6 +18,11 @@
 
 #include <config.h>
 
+/* Work around GCC bug 44511.  */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wreturn-type"
+#endif
+
 #if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
 
 /* Specification.  */
-- 
2.27.0

Subject: Re: grep-3.6 released [stable]
From: Andreas Schwab <[email-masked]>
To: [email-masked]
Date: Mon, 09 Nov 2020 17:12:54 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

grep 3.6 fails to build:

test-nl_langinfo-mt.c: In function 'threadN_func':
test-nl_langinfo-mt.c:185:1: error: no return statement in function returning non-void [-Werror=return-type]
  185 | }
      | ^
cc1: some warnings being treated as errors
make[4]: *** [Makefile:4221: test-nl_langinfo-mt.o] Error 1

Andreas.

-- 
Andreas Schwab, SUSE Labs, [email-masked]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."