Bug#1057594: tetradraw: FTBFS: interface.c:1069:36: error: invalid use of incomplete typedef ‘ITEM’ {aka ‘struct tagITEM’}

2023-12-18 Thread Sven Joachim
Control: tags -1 + patch

On 2023-12-05 23:11 +0100, Santiago Vila wrote:

> Package: src:tetradraw
> Version: 2.0.3-10
> Severity: serious
> Tags: ftbfs
>
> Dear maintainer:
>
> During a rebuild of all packages in unstable, your package failed to build:
>
> 
> interface.c: In function ‘tv_file_select’:
> interface.c:1069:36: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1069 | if(items[y]->index != index) 
> menu_driver(menu, REQ_DOWN_ITEM);
>   |^~
> interface.c:1079:32: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1079 | index = current->index;
>   |^~
> interface.c::56: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>   | index = current->index;
>   |^~
> interface.c:1136:40: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1136 | index = current->index;
>   |^~
> interface.c:1146:40: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1146 | index = current->index;
>   |^~
> interface.c: In function ‘file_select’:
> interface.c:1217:36: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1217 | if(items[y]->index != index) 
> menu_driver(menu, REQ_DOWN_ITEM);
>   |^~
> gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.  -Wdate-time -D_FORTIFY_SOURCE=2  -Wall 
> -ggdb3 -c -o load.o load.c
> interface.c:1221:32: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1221 | index = current->index;
>   |^~
> interface.c:1259:56: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1259 | index = current->index;
>   |^~
> interface.c:1284:40: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
item_index>  1284 | index = current->index;
>   |^~
> interface.c:1299:40: error: invalid use of incomplete typedef ‘ITEM’ {aka 
> ‘struct tagITEM’}
>  1299 | index = current->index;

These errors have been triggered by a recent change in ncurses which
makes the ITEM structure opaque, its members cannot be addressed
directly anymore.  The remedy is rather simple: instead of
item->index, use item_index(item) to retrieve the index.  See the
attached patch which can be added to the series file.

Disclaimer: I have only tested that the package builds, not if it works.

Cheers,
   Sven

From 037e6dd0794674264cee0049f49f39a60fe7cb40 Mon Sep 17 00:00:00 2001
From: Sven Joachim 
Date: Mon, 18 Dec 2023 17:14:36 +0100
Subject: [PATCH] Fix FTBFS with opaque ncurses

Since ncurses patchlevel 20231021 the ITEM structure is opaque, its
members cannot be addressed directly.  Use the item_index function
instead.
---
 src/interface.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/interface.c b/src/interface.c
index 2692b18..25a174d 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -1066,7 +1066,7 @@ char *tv_file_select(int next) {
 		post_menu(menu);

 		for(y = 0; items[y]; y++)
-			if(items[y]->index != index) menu_driver(menu, REQ_DOWN_ITEM);
+			if(item_index(items[y]) != index) menu_driver(menu, REQ_DOWN_ITEM);
 			else break;

 		if(next) {
@@ -1076,7 +1076,7 @@ char *tv_file_select(int next) {
 		}

 		current = current_item(menu);
-		index = current->index;
+		index = item_index(current);
 		wrefresh(wf);
 		while((ch = getch()) != 13) {
 			switch(ch) {
@@ -1108,7 +1108,7 @@ char *tv_file_select(int next) {
 	break;
 case TD_KEY_ESCAPE:
 	current = current_item(menu);
-	index = current->index;
+	index = item_index(current);

 	unpost_menu(menu);
 	free_menu(menu);
@@ -1133,7 +1133,7 @@ char *tv_file_select(int next) {
 	}
 			}
 			current = current_item(menu);
-			index = current->index;
+			index = item_index(current);
 			wrefresh(wf);
 		}
 		if(strcmp("", input)) {
@@ -1143,7 +1143,7 @@ char *tv_file_select(int next) {
 		} else {
 hugehack:
 			current = current_item(menu);
-			index = current->index;
+			index = item_index(current);
 			unpost_menu(menu);
 			free_menu(menu);
 			free_items(items);
@@ -1214,11 +1214,11 @@ char *file_select() {
 		post_menu(menu);

 		for(y = 0; items[y]; y++)
-			if(items[y]->index != index) menu_driver(menu, REQ_DOWN_ITEM);
+			

Bug#1057594: tetradraw: FTBFS: interface.c:1069:36: error: invalid use of incomplete typedef ‘ITEM’ {aka ‘struct tagITEM’}

2023-12-05 Thread Santiago Vila

Package: src:tetradraw
Version: 2.0.3-10
Severity: serious
Tags: ftbfs

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:


[...]
 debian/rules build
dh build --with autoreconf
   dh_update_autotools_config
   dh_autoreconf
autoreconf: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
aclocal: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.in,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
aclocal: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
configure.in:5: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.in:5: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:9833: AM_CONFIG_HEADER is expanded from...
configure.in:5: the top level
configure.in:7: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.in:7: You should run autoupdate.
./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from...
configure.in:7: the top level
configure.in:9: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are 
deprecated.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:9517: AM_INIT_AUTOMAKE is expanded from...
configure.in:9: the top level
configure.in:13: warning: The macro `AM_PROG_LIBTOOL' is obsolete.
configure.in:13: You should run autoupdate.
aclocal.m4:123: AM_PROG_LIBTOOL is expanded from...
configure.in:13: the top level
configure.in:18: warning: AC_OUTPUT should be used without arguments.
configure.in:18: You should run autoupdate.
autoheader: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
automake: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
configure.in:9: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are 
deprecated.  For more info, see:
configure.in:9: 
https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.in:11: installing './compile'
configure.in:9: installing './missing'
src/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or 
'*_CPPFLAGS')
src/Makefile.am: installing './depcomp'
automake: warning: autoconf input should be named 'configure.ac', not 
'configure.in'
src/Makefile.am:8: warning: 'CFLAGS' is a user variable, you should not 
override it;
src/Makefile.am:8: use 'AM_CFLAGS' instead
src/Makefile.am:6: warning: 'LDFLAGS' is a user variable, you should not 
override it;
src/Makefile.am:6: use 'AM_LDFLAGS' instead
   dh_auto_configure
./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=\${prefix}/include --mandir=\${prefix}/share/man 
--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-option-checking --disable-silent-rules 
--libdir=\${prefix}/lib/x86_64-linux-gnu --runstatedir=/run 
--disable-maintainer-mode --disable-dependency-tracking
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for an ANSI C-conforming const... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file