bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printf, wchar


From: Simon Josefsson
Subject: printf, wchar
Date: Thu, 07 Jun 2007 11:39:03 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.95 (gnu/linux)

On uClinux I got:

/bin/sh ../libtool --tag=CC   --mode=compile ucfront-gcc m68k-elf-gcc -m5200 
-DCONFIG_COLDFIRE -DHAVE_CONFIG_H -I. -I.. -I../../../lib/gl  -I../intl 
-I/data/fast/uclinux/uClinux-dist/lib/libgcrypt/inst/include 
-I/data/fast/uclinux/uClinux-dist/lib/libgpg-error/inst/include  -g 
-fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep-data 
-Dlinux -D__linux__ -Dunix -D__uClinux__ -MT printf-parse.lo -MD -MP -MF 
.deps/printf-parse.Tpo -c -o printf-parse.lo ../../../lib/gl/printf-parse.c
 ucfront-gcc m68k-elf-gcc -m5200 -DCONFIG_COLDFIRE -DHAVE_CONFIG_H -I. -I.. 
-I../../../lib/gl -I../intl 
-I/data/fast/uclinux/uClinux-dist/lib/libgcrypt/inst/include 
-I/data/fast/uclinux/uClinux-dist/lib/libgpg-error/inst/include -g 
-fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep-data 
-Dlinux -D__linux__ -Dunix -D__uClinux__ -MT printf-parse.lo -MD -MP -MF 
.deps/printf-parse.Tpo -c ../../../lib/gl/printf-parse.c -o printf-parse.o
In file included from ./wchar.h:42,
                 from ./stdint.h:94,
                 from ../../../lib/gl/printf-parse.c:39:
/data/fast/uclinux/uClinux-dist/uClibc/include/wchar.h:32:2: error: #error 
Attempted to include wchar.h when uClibc built without wide char support.
make[7]: *** [printf-parse.lo] Error 1

Configure says:

checking wchar.h usability... no
checking wchar.h presence... no
checking for wchar.h... no

The tests fail because:

configure:24279: checking wchar.h usability
configure:24296: ucfront-gcc m68k-elf-gcc -m5200 -DCONFIG_COLDFIRE -c  -g 
-fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep-data 
-Dlinux -D__linux__ -Dunix -D__uClinux__  conftest.c >&5
In file included from conftest.c:82:
/data/fast/uclinux/uClinux-dist/uClibc/include/wchar.h:32:2: error: #error 
Attempted to include wchar.h when uClibc built without wide char support.
configure:24302: $? = 1

Config.h contains:

/* Define this to an absolute name of <wchar.h>. */
#define ABSOLUTE_WCHAR_H ""
...
/* Define to 1 if you have the <wchar.h> header file. */
/* #undef HAVE_WCHAR_H */

I have tested that this patch solves the problem on uClinux.  What do
you think?

Alternatively, stdint_.h could avoid including wchar.h, but this fix
seems cleaner because printf can always assume wchar.h, and the wchar
module is responsible for making it appear as if the wchar.h intefaces
works.

2007-06-07  Simon Josefsson  <address@hidden>

        * lib/wchar_.h: Don't include wchar.h if missing.

--- wchar_.h    30 May 2007 15:01:38 +0200      1.5
+++ wchar_.h    07 Jun 2007 11:31:38 +0200      
@@ -35,6 +35,7 @@
 #include <stdio.h>
 #include <time.h>
 
+#if HAVE_WCHAR_H
 /* Include the original <wchar.h>.  */
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_INCLUDE_NEXT@
@@ -42,6 +43,7 @@
 #else
 # include @ABSOLUTE_WCHAR_H@
 #endif
+#endif
 
 #ifndef _GL_WCHAR_H
 #define _GL_WCHAR_H




reply via email to

[Prev in Thread] Current Thread [Next in Thread]