NL_TEXTMAX == INT_MAX?
H . J . Lu
hjl@lucon.org
Tue May 16 18:02:00 GMT 2000
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.
More information about the Libc-hacker
mailing list