Bug#1066560: gmemusage: FTBFS: hash.c:42:13: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]

2024-06-09 Thread Bastian Germann

I am uploading a NMU with the attached changes to fix this.diff -Nru gmemusage-0.2/Makefile gmemusage-0.2/Makefile
--- gmemusage-0.2/Makefile  2024-06-09 16:42:55.0 +
+++ gmemusage-0.2/Makefile  1998-01-14 16:45:13.0 +
@@ -26,7 +26,7 @@
 # You shouldn't need to modify anything below this line
 #
 OPTIONS = $(BELL_ON_UNKNOWN_KEYPRESS) $(USE_PASTELS) $(SAVE_XSERVER_MEMORY)
-CFLAGS = $(OPTIM) -Wall $(OPTIONS) -g
+CFLAGS = $(OPTIM) -Wall $(OPTIONS)
 LDFLAGS = $(OPTIM)
 LIBX11 = $(LIBX11DIR) -lX11
 LIBS = $(LIBX11)
diff -Nru gmemusage-0.2/debian/changelog gmemusage-0.2/debian/changelog
--- gmemusage-0.2/debian/changelog  2024-06-09 16:42:55.0 +
+++ gmemusage-0.2/debian/changelog  2024-06-09 16:24:40.0 +
@@ -1,3 +1,11 @@
+gmemusage (0.2-11.1) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Convert to source format 3.0 (closes: #1007369)
+  * Add missing includes (closes: #1066560)
+
+ -- Bastian Germann   Sun, 09 Jun 2024 16:24:40 +
+
 gmemusage (0.2-11) unstable; urgency=low
 
   * Adopt the package (Closes: #486759).
diff -Nru gmemusage-0.2/debian/patches/10_misc.patch 
gmemusage-0.2/debian/patches/10_misc.patch
--- gmemusage-0.2/debian/patches/10_misc.patch  2024-06-09 16:42:55.0 
+
+++ gmemusage-0.2/debian/patches/10_misc.patch  2024-06-09 16:24:40.0 
+
@@ -64,6 +64,14 @@
  #if 0
 --- gmemusage-0.2.orig/proc.c
 +++ gmemusage-0.2/proc.c
+@@ -7,6 +7,7 @@
+  * See file COPYING (included in this distribution) for copyright information.
+  */
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
 @@ -23,6 +23,9 @@
  /*
   * Set values for various memory usages
diff -Nru gmemusage-0.2/debian/patches/20_makefile.patch 
gmemusage-0.2/debian/patches/20_makefile.patch
--- gmemusage-0.2/debian/patches/20_makefile.patch  2024-06-09 
16:42:55.0 +
+++ gmemusage-0.2/debian/patches/20_makefile.patch  2024-06-09 
16:24:40.0 +
@@ -1,5 +1,5 @@
 Makefile.orig  2008-11-28 18:37:30.0 +0100
-+++ Makefile   2008-11-28 18:38:01.0 +0100
+--- memusage-0.2.orig/Makefile 2008-11-28 18:37:30.0 +0100
 memusage-0.2/Makefile  2008-11-28 18:38:01.0 +0100
 @@ -19,15 +19,12 @@
  # Change these variables as necessary
  #
@@ -11,7 +11,7 @@
  # You shouldn't need to modify anything below this line
  #
  OPTIONS = $(BELL_ON_UNKNOWN_KEYPRESS) $(USE_PASTELS) $(SAVE_XSERVER_MEMORY)
--CFLAGS = $(OPTIM) -Wall $(OPTIONS) -g
+-CFLAGS = $(OPTIM) -Wall $(OPTIONS)
 -LDFLAGS = $(OPTIM)
  LIBX11 = $(LIBX11DIR) -lX11
  LIBS = $(LIBX11)
diff -Nru gmemusage-0.2/debian/patches/add-includes.patch 
gmemusage-0.2/debian/patches/add-includes.patch
--- gmemusage-0.2/debian/patches/add-includes.patch 1970-01-01 
00:00:00.0 +
+++ gmemusage-0.2/debian/patches/add-includes.patch 2024-06-09 
16:24:40.0 +
@@ -0,0 +1,15 @@
+Description: Add missing includes
+Author: Bastian Germann 
+Bug-Debian: https://bugs.debian.org/1066560
+---
+--- gmemusage-0.2.orig/hash.c
 gmemusage-0.2/hash.c
+@@ -7,6 +7,8 @@
+  * See file COPYING (included in this distribution) for copyright information.
+  */
+ #include 
++#include 
++#include 
+ #include 
+ #include "common.h"
+ 
diff -Nru gmemusage-0.2/debian/patches/series 
gmemusage-0.2/debian/patches/series
--- gmemusage-0.2/debian/patches/series 1970-01-01 00:00:00.0 +
+++ gmemusage-0.2/debian/patches/series 2024-06-09 16:24:40.0 +
@@ -0,0 +1,3 @@
+10_misc.patch
+20_makefile.patch
+add-includes.patch
diff -Nru gmemusage-0.2/debian/rules gmemusage-0.2/debian/rules
--- gmemusage-0.2/debian/rules  2024-06-09 16:42:55.0 +
+++ gmemusage-0.2/debian/rules  2024-06-09 16:24:17.0 +
@@ -2,7 +2,6 @@
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/makefile.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
 
 DEB_INSTALL_MANPAGES_gmemusage := gmemusage.1
 
diff -Nru gmemusage-0.2/debian/source/format gmemusage-0.2/debian/source/format
--- gmemusage-0.2/debian/source/format  1970-01-01 00:00:00.0 +
+++ gmemusage-0.2/debian/source/format  2024-06-09 16:21:10.0 +
@@ -0,0 +1 @@
+3.0 (quilt)


Bug#1066560: gmemusage: FTBFS: hash.c:42:13: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]

2024-03-13 Thread Lucas Nussbaum
Source: gmemusage
Version: 0.2-11
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20240313 ftbfs-trixie ftbfs-impfuncdef

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

This is most likely caused by a change in dpkg 1.22.6, that enabled
-Werror=implicit-function-declaration. For more information, see
https://wiki.debian.org/qa.debian.org/FTBFS#A2024-03-13_-Werror.3Dimplicit-function-declaration

Relevant part (hopefully):
> gcc -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2  -c -o hash.o hash.c
> hash.c: In function ‘LookupProc’:
> hash.c:42:13: error: implicit declaration of function ‘strcmp’ 
> [-Werror=implicit-function-declaration]
>42 |   if ( !strcmp ( pi -> procname , name ) )
>   | ^~
> hash.c:12:1: note: include ‘’ or provide a declaration of ‘strcmp’
>11 | #include "common.h"
>   +++ |+#include 
>12 | 
> hash.c: In function ‘addProc’:
> hash.c:70:10: error: implicit declaration of function ‘exit’ 
> [-Werror=implicit-function-declaration]
>70 |  exit ( 1 ) ;
>   |  ^~~~
> hash.c:12:1: note: include ‘’ or provide a declaration of ‘exit’
>11 | #include "common.h"
>   +++ |+#include 
>12 | 
> hash.c:70:10: warning: incompatible implicit declaration of built-in function 
> ‘exit’ [-Wbuiltin-declaration-mismatch]
>70 |  exit ( 1 ) ;
>   |  ^~~~
> hash.c:70:10: note: include ‘’ or provide a declaration of ‘exit’
> hash.c:74:7: error: implicit declaration of function ‘strcpy’ 
> [-Werror=implicit-function-declaration]
>74 |   strcpy ( thisproc -> procname , procname ) ;
>   |   ^~
> hash.c:74:7: note: include ‘’ or provide a declaration of ‘strcpy’
> hash.c:74:7: warning: incompatible implicit declaration of built-in function 
> ‘strcpy’ [-Wbuiltin-declaration-mismatch]
> hash.c:74:7: note: include ‘’ or provide a declaration of ‘strcpy’
> hash.c:96:13: warning: incompatible implicit declaration of built-in function 
> ‘exit’ [-Wbuiltin-declaration-mismatch]
>96 | exit ( 1 ) ;
>   | ^~~~
> hash.c:96:13: note: include ‘’ or provide a declaration of ‘exit’
> hash.c:101:7: warning: incompatible implicit declaration of built-in function 
> ‘strcpy’ [-Wbuiltin-declaration-mismatch]
>   101 |   strcpy ( thisproc -> procname , procname ) ;
>   |   ^~
> hash.c:101:7: note: include ‘’ or provide a declaration of ‘strcpy’
> cc1: some warnings being treated as errors
> make[1]: *** [: hash.o] Error 1


The full build log is available from:
http://qa-logs.debian.net/2024/03/13/gmemusage_0.2-11_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na=ign=7=7=only=ftbfs-20240313=lu...@debian.org=1=1=1=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.