Bug#1066285: nvi: FTBFS: ../dist/../common/options_f.c:324:16: error: implicit declaration of function 'conv_enc' [-Werror=implicit-function-declaration]

2024-04-10 Thread Michael Hudson-Doyle
Package: nvi
Followup-For: Bug #1066285
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch
X-Debbugs-Cc: michael.hud...@ubuntu.com
Control: tags -1 patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * d/patches/add-prototypes.h: add includes and prototypes for some functions
(including prototypes for some standard functions that are only accessible
if _XOPEN_SOURCE is defined, but lots of other stuff breaks if that is
defined :/).

Thanks for considering the patch.

Cheers,
mwh

-- System Information:
Debian Release: trixie/sid
  APT prefers mantic-updates
  APT policy: (500, 'mantic-updates'), (500, 'mantic-security'), (500, 
'mantic'), (100, 'mantic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-27-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_NZ.UTF-8:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru nvi-1.81.6/debian/control nvi-1.81.6/debian/control
--- nvi-1.81.6/debian/control   2024-03-03 09:35:03.0 +1300
+++ nvi-1.81.6/debian/control   2024-04-11 14:45:28.0 +1200
@@ -1,8 +1,7 @@
 Source: nvi
 Section: editors
 Priority: optional
-Maintainer: Ubuntu Developers 
-XSBC-Original-Maintainer: Tobias Heider 
+Maintainer: Tobias Heider 
 Standards-Version: 4.6.2
 Build-Depends:
  debhelper-compat (= 13),
diff -Nru nvi-1.81.6/debian/patches/add-prototypes.patch 
nvi-1.81.6/debian/patches/add-prototypes.patch
--- nvi-1.81.6/debian/patches/add-prototypes.patch  1970-01-01 
12:00:00.0 +1200
+++ nvi-1.81.6/debian/patches/add-prototypes.patch  2024-04-11 
14:45:28.0 +1200
@@ -0,0 +1,53 @@
+--- a/common/conv.h
 b/common/conv.h
+@@ -21,3 +21,6 @@
+   char2wchar_tinput2int;
+   wchar2char_tint2disp;
+ };
++
++extern int conv_enc (SCR *sp, int option, char *enc);
++extern void conv_init (SCR *orig, SCR *sp);
+--- a/cl/cl.h
 b/cl/cl.h
+@@ -26,6 +26,11 @@
+ #endif
+ #endif
+ 
++/*
++ * for setupterm()
++ */
++#include 
++
+ typedef struct _cl_private {
+   char ibuf[256]; /* Input keys. */
+ 
+--- a/common/multibyte.h
 b/common/multibyte.h
+@@ -5,6 +5,12 @@
+ #include 
+ #include 
+ 
++/*
++ * This is declared by wchar.h, but only if _XOPEN_SOURCE is set and lots of
++ * other things break if we define that.
++ */
++extern int wcwidth (wchar_t c);
++
+ typedef   wchar_t RCHAR_T;
+ #define RCHAR_T_MAX   ((1 << 24)-1)
+ typedef   wchar_t CHAR_T;
+--- a/cl/cl_funcs.c
 b/cl/cl_funcs.c
+@@ -31,6 +31,12 @@
+ #include "../vi/vi.h"
+ #include "cl.h"
+ 
++/*
++ * This is declared by ncurses.h, but only if _XOPEN_SOURCE is set and lots of
++ * other things break if we define that.
++ */
++extern int waddnwstr (WINDOW *,const wchar_t *,int);
++
+ static void cl_rdiv __P((SCR *));
+ 
+ static int 
diff -Nru nvi-1.81.6/debian/patches/series nvi-1.81.6/debian/patches/series
--- nvi-1.81.6/debian/patches/series2024-02-14 02:52:27.0 +1300
+++ nvi-1.81.6/debian/patches/series2024-04-11 14:44:02.0 +1200
@@ -36,3 +36,4 @@
 upstream/0036-Fix-how-keywords-are-picked-up.patch
 upstream/0037-New-macro-MEMPCPY.patch
 upstream/0038-Fix-A-word-search-for-keywords-starting-with-a-non-w.patch
+add-prototypes.patch


Bug#1066285: nvi: FTBFS: ../dist/../common/options_f.c:324:16: error: implicit declaration of function 'conv_enc' [-Werror=implicit-function-declaration]

2024-03-13 Thread Lucas Nussbaum
Source: nvi
Version: 1.81.6-20
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):
>  x86_64-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../dist -D__REGEX_PRIVATE -I. 
> -I../dist/../include -DVI=\"/usr/bin/nvi-ipc\" -I../dist/../regex -Wdate-time 
> -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 
> -Werror=implicit-function-declaration -ffile-prefix-map=/<>=. 
> -fstack-protector-strong -fstack-clash-protection -Wformat 
> -Werror=format-security -fcf-protection -c ../dist/../common/options_f.c -o 
> options_f.o
> ../dist/../common/options_f.c: In function 'f_encoding':
> ../dist/../common/options_f.c:324:16: error: implicit declaration of function 
> 'conv_enc' [-Werror=implicit-function-declaration]
>   324 | return conv_enc(sp, offset, str);
>   |^~~~
> cc1: some warnings being treated as errors
> make[3]: *** [Makefile:902: options_f.lo] Error 1


The full build log is available from:
http://qa-logs.debian.net/2024/03/13/nvi_1.81.6-20_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.