#39677: Compilation of gettext-0.20.1 fails with "conflicting types for '_findclose'" error Open Date: 2019-10-14 17:47 Last Update: 2019-10-14 20:31 URL for this Ticket: https://osdn.net//projects/mingw/ticket/39677 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39677 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2019-10-14 20:31 Updated by: keith Comment: On the face of it, this is a puzzling failure ... the error message shows identically the same declaration in both instances, so there really appears to be no conflict! However, re-running the failing command, with the -E option in place of -c, and the -o msgfmt-write-qt.o removed is rather more informative. It may be noticed, even from the original error message, that <io.h> is included twice; initially by GnuLib's "iconv.h" wrapper, via <wchar.h>, and subsequently by GnuLib's "sys/stat.h" replacement. The first inclusion is selective, exposing only the subset of <io.h> content which Microsoft require to be exposed when including <wchar.h>, and thus, does not activate the _IO_H repeat-inclusion guard; the second is normal (full) inclusion, which does activate the _IO_H guard. The declaration of _findclose is exposed, supposedly identically in both passes, as does indeed appear to be the case, from inspection of the error message alone. What isn't obvious, from the original error message, is that GnuLib introduces a conflict between the first and second inclusions of <io.h>. It may be seen, by inspection of the preprocessor output; during the first inclusion of <io.h>, _findclose is declared (correctly) thus: 1. _CRTIMP __cdecl __MINGW_NOTHROW int _findclose (intptr_t); However, by the time we get to the second inclusion, GnuLib has trashed the preprocessor environment, by the introduction of: 1. typedef long int gl_intptr_t; 2. # define intptr_t gl_intptr_t and thus, in the second pass through <io.h>, the declaration of _findclose becomes: 1. _CRTIMP __cdecl __MINGW_NOTHROW int _findclose (gl_intptr_t); and GCC (correctly) rejects the change in the declared type of the function's argument. --------------------------------------------------------------------- Ticket Status: Reporter: keith Owner: (None) Type: Issues Status: Open Priority: 5 - Medium MileStone: (None) Component: WSL Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: When compiling GNU gettext-0.20.1 with GCC-8.2.0 and mingwrt-5.2.2, I see: mingw32-gcc -DLOCALEDIR=\"/mingw/share/locale\" -DBISON_LOCALEDIR=\"/usr/share/locale\" -DLOCALE_ALIAS_PATH=\"/mingw/share/locale\" -DUSEJAVA=1 -DGETTEXTJAR=\"/mingw/share/gettext/gettext.jar\" -DLIBDIR=\"/mingw/lib\" -DGETTEXTDATADIR=\"/mingw/share/gettext\" -DPROJECTSDIR=\"/mingw/share/gettext/projects\" -DEXEEXT=\".exe\" -DHAVE_CONFIG_H -I. -I../../../src/gettext-0.20.1/gettext-tools/src -I.. -I. -I../../../src/gettext-0.20.1/gettext-tools/src -I.. -I../../../src/gettext-0.20.1/gettext-tools -I../../../src/gettext-0.20.1/gettext-tools/libgrep -I../gnulib-lib -I../../../src/gettext-0.20.1/gettext-tools/gnulib-lib -I../intl -I../../../src/gettext-0.20.1/gettext-tools/../gettext-runtime/intl -DINSTALLDIR=\"/mingw/bin\" -I/mingw/include -g -O2 -c -o msgfmt-write-qt.o `test -f 'write-qt.c' || echo '../../../src/gettext-0.20.1/gettext-tools/src/'`write-qt.c In file included from ../gnulib-lib/sys/stat.h:542, from ../gnulib-lib/fcntl.h:58, from ../../../src/gettext-0.20.1/gettext-tools/gnulib-lib/binary-io.h:22, from ../../../src/gettext-0.20.1/gettext-tools/src/write-qt.c:43: /home/keith/mingw32-gcc-8.2.0/include/io.h:484:38: error: conflicting types for '_findclose' _CRTIMP __cdecl __MINGW_NOTHROW int _findclose (intptr_t); ^~~~~~~~~~ In file included from /home/keith/mingw32-gcc-8.2.0/include/wchar.h:254, from ../gnulib-lib/wchar.h:87, from /mingw/include/iconv.h:110, from ../gnulib-lib/iconv.h:27, from ../../../src/gettext-0.20.1/gettext-tools/src/po-charset.h:25, from ../../../src/gettext-0.20.1/gettext-tools/src/write-qt.c:35: /home/keith/mingw32-gcc-8.2.0/include/io.h:484:38: note: previous declaration of '_findclose' was here _CRTIMP __cdecl __MINGW_NOTHROW int _findclose (intptr_t); ^~~~~~~~~~ make[5]: *** [Makefile:3324: msgfmt-write-qt.o] Error 1 -- Ticket information of MinGW - Minimalist GNU for Windows project MinGW - Minimalist GNU for Windows Project is hosted on OSDN Project URL: https://osdn.net/projects/mingw/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/mingw/ticket/39677 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39677