This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: limits.h


J. Johnston wrote:
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.
Of course, I'm using --enable-newlib-mb. MB_LEN_MAX macro is 8 in Newlib's limits.h but the problem is that I can't include it in my programs: #include <limits.h> includes GCC's limits.h which defines MB_LEN_MAX to 1. Newlib's limits.h isn't included at all.

Obviously, this isn't Newlib's problem - this is GCC's problem or problem of how I build GCC+Newlib.

Best Regards, Artem B. Bityuckiy.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]