[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compilation warnings on MinGW due to Gnulib's wcwidth
From: |
Eli Zaretskii |
Subject: |
Compilation warnings on MinGW due to Gnulib's wcwidth |
Date: |
Thu, 18 Jun 2015 18:26:37 +0300 |
Building the current Texinfo trunk tip with MinGW produces a barrage
of compiler warnings like these:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -Id:/usr/include -gdwarf-4 -g3
-O2 -MT mbscasecmp.o -MD -MP -MF $depbase.Tpo -c -o mbscasecmp.o mbscasecmp.c
&&\
mv -f $depbase.Tpo $depbase.Po
In file included from mbuiter.h:106:0,
from mbscasecmp.c:27:
mbchar.h: In function 'mb_width_aux':
mbchar.h:249:3: warning: implicit declaration of function 'wcwidth'
[-Wimplicit-function-declaration]
int w = wcwidth (wc);
^
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -Id:/usr/include -gdwarf-4 -g3
-O
2 -MT mbsncasecmp.o -MD -MP -MF $depbase.Tpo -c -o mbsncasecmp.o
mbsncasecmp.c &
&\
mv -f $depbase.Tpo $depbase.Po
In file included from mbuiter.h:106:0,
from mbsncasecmp.c:27:
mbchar.h: In function 'mb_width_aux':
mbchar.h:249:3: warning: implicit declaration of function 'wcwidth'
[-Wimplicit-
function-declaration]
int w = wcwidth (wc);
^
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I..
-I../gnulib/lib -I../gnulib/lib
-DLOCALEDIR=\"d:/usr/share/locale\"
-DINFODIR=\"d:/usr/share/info\" -DINFODIR2=\"d:/usr/share/info\"
-Id:/usr/include -gdwarf-4 -g3 -O2 -MT dir.o -MD -MP -MF .deps/dir.Tpo -c -o
dir.o dir.c
In file included from ../system.h:54:0,
from info.h:26,
from dir.c:22:
../gnulib/lib/mbchar.h: In function 'mb_width_aux':
../gnulib/lib/mbchar.h:249:3: warning: implicit declaration of function
'wcwidth' [-Wimplicit-function-declaration]
int w = wcwidth (wc);
^
As you see, the warnings are produced both while compiling Gnulib
files and while compiling the 'info' program.
I don't understand fully what's going on, since the prototype of
wcwidth is in Gnulib's wchar.h. I think there's some snafu with this
tricky condition:
#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux &&
((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined
_GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
/* Special invocation convention:
- Inside glibc and uClibc header files.
- On HP-UX 11.00 we have a sequence of nested includes
<wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
and once directly. In both situations 'wint_t' is not yet defined,
therefore we cannot provide the function overrides; instead include only
the system's <wchar.h>.
- On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
the latter includes <wchar.h>. But here, we have no way to detect
whether
<wctype.h> is completely included or is still being included. */
#include_next <wchar.h>
#else
/* Normal invocation convention. */
I think something (perhaps _GL_ALREADY_INCLUDING_WCHAR_H?) goes wrong
with this in several source files, and the result is that only MinGW's
own wchar.h is included, which lacks wcwidth declaration.
Let me know if I can provide more information.
Thanks.
P.S. Please cc me on any replies, as I'm not subscribed to the list.
- Compilation warnings on MinGW due to Gnulib's wcwidth,
Eli Zaretskii <=
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Gavin Smith, 2015/06/18
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Eli Zaretskii, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Gavin Smith, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Gavin Smith, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Eli Zaretskii, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Gavin Smith, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Eli Zaretskii, 2015/06/20
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Gavin Smith, 2015/06/19
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Eli Zaretskii, 2015/06/20
- Re: Compilation warnings on MinGW due to Gnulib's wcwidth, Paul Eggert, 2015/06/21