This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: NL_TEXTMAX == INT_MAX?


On Wed, May 17, 2000 at 02:53:08AM +0200, Mark Kettenis wrote:
>    Date: Tue, 16 May 2000 17:24:23 -0700
>    From: "H . J . Lu" <hjl@lucon.org>
> 
>    In glibc 2.1.3, we have
> 
>    /* Maximum number of bytes in a message.  We have no limit.  */
>    #define NL_TEXTMAX      INT_MAX 
> 
>    in <bits/xopen_lim.h>. I don't think it makes any senses. A program
>    I am working on has
> 
> 	   char msg [NL_TEXTMAX];
> 
>    You can guess what happens. On Solaris 2.7/ia32, it is defined as 2048. 
>    If glibc does support long messages, 4096k should be more than enough.
>    I'd like to see a more reasonable number.
> 
> INT_MAX is the only reasonable number.  The X/Open standard only
> specifies a minimum value.  The GNU coding standards clearly state
> that arbitrary limits should be avoided.  The program you're working
> on has a bug.  The fix should be obvious :-).

I won't buy you can create a message with INT_MAX bytes.


H.J.

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