Subject: bug#78618: closed (Re: bug#78618: Gzip 1.14 build failure on s390x (undeclared errno in dfltcc.c))

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 30 May 2025 19:34:02 +0000

Your bug report

#78618: Gzip 1.14 build failure on s390x (undeclared errno in dfltcc.c)

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

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

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

Subject: Re: bug#78618: Gzip 1.14 build failure on s390x (undeclared errno in dfltcc.c)
From: Paul Eggert <[email-masked]>
To: Jakub Martisko <[email-masked]>
Cc: [email-masked]
Date: Fri, 30 May 2025 12:32:56 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for reporting that. I installed the attached slightly-different 
patch (different because it includes errno.h in same order as other files).

From c76affb4551630ff661ac1c1ee99353a17eb16e1 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Fri, 30 May 2025 12:31:04 -0700
Subject: [PATCH] gzip: fix s390x build failure

Problem reported by Jakub Martisko <https://bugs.gnu.org/78618>.
* dfltcc.c: Include errno.h.
---
 dfltcc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dfltcc.c b/dfltcc.c
index 9f86581..8307a97 100644
--- a/dfltcc.c
+++ b/dfltcc.c
@@ -17,6 +17,7 @@
 
 #include <config.h>
 
+#include <errno.h>
 #include <stdlib.h>
 
 #ifdef HAVE_SYS_SDT_H
-- 
2.48.1

Subject: Gzip 1.14 build failure on s390x (undeclared errno in dfltcc.c)
From: Jakub Martisko <[email-masked]>
To: [email-masked]
Date: Wed, 28 May 2025 13:01:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

while rebasing the gzip in fedora I've encountered the build failure from
the $SUBJ.
A bit more info:
- happens only when configured with the --enable-dfltcc
- introduced  by the [1] (the "errno" variable doesn't seem to be used
outside of the scope of the patch)
- build completes when the "--enable-dfltcc" is not used or when the [1] is
reversed
- The actual error (I can provide patch if needed):

dfltcc.c:441:15: error: 'errno' undeclared (first use in this function)
  441 |               errno = 0;
      |               ^~~~~
dfltcc.c:28:1: note: 'errno' is defined in header '<errno.h>'; this is
probably fixable by adding '#include <errno.h>'
   27 | #include "gzip.h"
  +++ |+#include <errno.h>
   28 |
dfltcc.c:441:15: note: each undeclared identifier is reported only
once for each function it appears in
  441 |               errno = 0;
      |               ^~~~~
make[2]: *** [Makefile:2050: dfltcc.o] Error 1

[1]:
https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?h=v1.14&id=23ddd95f3e152423fe0dfc96ff31d4130a65e8cf