bug-gnulib
[Top][All Lists]
Advanced

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

Re: #ifndef _GL_WCHAR_H in lib/wchar.in.h


From: Albert Chin
Subject: Re: #ifndef _GL_WCHAR_H in lib/wchar.in.h
Date: Thu, 15 Jan 2009 13:55:15 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Jan 15, 2009 at 12:27:36AM +0100, Bruno Haible wrote:
> > This causes a problem on HP-UX 11.00 because <wchar.h> is included more
> > than once.
> >   $ ./gnulib-tool --create-testdir --dir=t arpa_inet crypto/md5 \
> >   environ filemode fnmatch fnmatch-gnu getdate gettext glob human \
> >   iconv_open inet_pton lstat mbswidth memmem mktime modechange poll \
> >   regex socklen strcase strftime strptime strtok_r vsnprintf \
> >   vsnprintf-posix wcwidth
> >   $ cd t
> >   $ ./configure
> >   $ gmake
> >   ...
> >   cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -c -o btowc.o btowc.c
> >   cc: "wchar.h", line 124: error 1000: Unexpected symbol: "btowc".
> >   cc: panic 2017: Cannot recover from earlier errors, terminating.
> >   gmake[4]: *** [btowc.o] Error 1
> > 
> >   $ cd gllib
> > 
> >   $ cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -E btowc.c | grep wchar.h
> >   # 1 "./wchar.h"
> >   # 49 "./wchar.h"
> >   # 50 "./wchar.h"
> >   # 51 "./wchar.h"
> >   # 1 "///usr/include/wchar.h"
> >   # 33 "///usr/include/wchar.h"
> >   # 1 "./wchar.h"
> >   # 49 "./wchar.h"
> >   # 50 "./wchar.h"
> >   # 51 "./wchar.h"
> >   # 1 "///usr/include/wchar.h"
> >   # 57 "./wchar.h"
> >   # 1 "./wchar.h"
> >   # 42 "///usr/include/wchar.h"
> >   # 57 "./wchar.h"
> 
> I reproduce. But I needed to look at the entire preprocessed output in order
> to understand what happens. Fixed as follows:
> 
> [ snip snip ]

Thanks. I can confirm the fix for HP-UX. Looks like I missed another
platform where this is a problem, IRIX. Using the same gnulib-tool
invocation as on HP-UX:
  $ ./gnulib-tool --create-testdir --dir=t arpa_inet crypto/md5 \
  environ filemode fnmatch fnmatch-gnu getdate gettext glob human \
  iconv_open inet_pton lstat mbswidth memmem mktime modechange poll \
  regex socklen strcase strftime strptime strtok_r vsnprintf \
  vsnprintf-posix wcwidth
  $ cd t
  $ ./configure
  $ gmake
  ...
  cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -c -o getdate.o getdate.c
  cc-1020 cc: ERROR File = ./wchar.h, Line = 258
    The identifier "mbstate_t" is undefined.

    extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
                                                ^

  cc-3425 cc: WARNING File = /usr/include/internal/wchar_core.h, Line = 425
    pragma usage is incorrect as it expects a function or variable name

    #pragma optional wcrtomb
                            ^

  1 error detected in the compilation of "getdate.c".
  gmake[2]: *** [getdate.o] Error 2

  $ cd gllib
  $ cc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -E getdate.c | \
  grep mbstate_t | head -2
  extern size_t rpl_wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
          typedef char    mbstate_t;

How about adding something like "|| (defined __sgi && defined
_GL_JUST_INCLUDE_SYSTEM_WCHAR_H)" to your patch?

-- 
albert chin (address@hidden)




reply via email to

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