Bug#880492: bsdgames: FTBFS: conflicting declaration of 'char* fgetln(FILE*, size_t*)' with 'C' linkage

Sven Joachim svenjoac at gmx.de
Wed Nov 1 08:19:07 UTC 2017


Source: bsdgames
Version: 2.17-25
Tags: buster sid patch

While working on switching ncurses to the new ABI (see #230990) I
noticed that bsdgames FTBFS with libncurses6.  From my pbuilder log:

,----
| g++ -g -O2 -Wall -W -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -g -O2 -fdebug-prefix-map=/build/bsdgames-2.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/bsdgames-2.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -Iinclude   -Idab  -c dab/gamescreen.cc -o dab/gamescreen.o
| In file included from /usr/include/wchar.h:36:0,
|                  from /usr/include/curses.h:400,
|                  from dab/box.cc:48:
| include/stdio.h:38:14: error: conflicting declaration of 'char* fgetln(FILE*, size_t*)' with 'C' linkage
|  extern char *fgetln(FILE *stream, size_t *len);
|               ^~~~~~
| In file included from /usr/include/curses.h:183:0,
|                  from dab/box.cc:48:
| include/stdio.h:38:14: note: previous declaration with 'C++' linkage
|  extern char *fgetln(FILE *stream, size_t *len);
|               ^~~~~~
| GNUmakefile:298: recipe for target 'dab/box.o' failed
| make[2]: *** [dab/box.o] Error 1
`----

I am not sure why this has not been triggered earlier, but it seems that
fgetln really needs to be declared as extern "C" for a C++ compiler.
Attached is a patch that works for me and which you can drop into
debian/patches, stolen from the Fedora package.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fix-include-stdio.h-C-incompatibility.patch
Type: text/x-diff
Size: 1499 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20171101/54216caf/attachment.patch>


More information about the Pkg-games-devel mailing list