NL_TEXTMAX == INT_MAX?

Mark Kettenis kettenis@wins.uva.nl
Tue May 16 17:53:00 GMT 2000


   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 :-).

Mark



More information about the Libc-hacker mailing list