J. Johnston
Fri Oct 24 15:56:00 GMT 2003

Artem B. Bityuckiy wrote:
> Hello.
> I'm using gcc-3.2 for arm-elf target.
> Configure command line is:
> --host=i686-pc-linux-gnu --target=arm-elf --enable-libstdcxx-v3 
> --with-target-short-wchar --norecursion --with-headers=/home/... 
> --with-headers=/home/...
> I'm using gcc with Newlib-1.11.0.
> I need to have correct MB_LEN_MAX macro in my programs. This correct 
> value is defined in Newlib's limits.h. But gcc masks Newlib's limits.h 
> by its own limits.h version witch defines MB_LEN_MAX as 1. GCC's 
> limits.h doesn't include Newlib's limits.h recursively.
> GCC 3.2.2 on my RH9 Linux host doesn't has such problem - his limits.h 
> have a directive '#include_next <limits.h>'.
> I need to have such a directive in my gcc-3.2. How can I do this?
> It seems that limits.h is generated file - there is no such file in gcc 
> sources. Also, as I've found, gcc-3.2 adds such '#include_next' when is 
> configured to i386-linux target. Some utility 'fixinc' exists in gcc 
> source tree which as I've investigated fixes gcc's includes.
> Please, tell me how to fix gcc-3.2. May be I should add some 'configure' 
> option... Any helpful links ?
> Thanks a lot.
> Artem.

Regarding the newlib side, you should be configuring with --enable-newlib-mb, 
otherwise MB_LEN_MAX will end up 1 for newlib.

-- Jeff J.

More information about the Newlib mailing list