bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: getdelim.c needs SIZE_MAX


From: Derek Price
Subject: Re: FYI: getdelim.c needs SIZE_MAX
Date: Wed, 05 Oct 2005 17:01:16 -0400
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Simon Josefsson wrote:

>Derek Price <address@hidden> writes:
>  
>
>>may not be defined.  I've installed the attached patch, ripped verbatim
>>from serveral other modules.
>>    
>>
>
>Shouldn't we use the size_max module instead?
>  
>

I'm not sure.  Some 18 modules currently don't, defining SIZE_MAX
themselves.  Do you know why not?  I seem to recall a past discussion on
this list that decided that replacing 3 lines of code wasn't worth the
module dependancy, I thought in regards to this module, though I can't
find the thread.  I think the size_max module is only important if you
want to use SIZE_MAX as part of a preprocessor conditional - otherwise
this definition works fine.

address@hidden gnulib]$ fgrep -w 'define SIZE_MAX' lib/*.[hc]
lib/argp-help.c:# define SIZE_MAX ((size_t) -1)
lib/backupfile.c:# define SIZE_MAX ((size_t) -1)
lib/error.c:#  define SIZE_MAX ((size_t) -1)
lib/fnmatch.c:# define SIZE_MAX ((size_t) -1)
lib/fts.c:# define SIZE_MAX ((size_t) -1)
lib/getdelim.c:# define SIZE_MAX ((size_t) -1)
lib/getndelim2.c:# define SIZE_MAX ((size_t) -1)
lib/hash.c:# define SIZE_MAX ((size_t) -1)
lib/human.c:# define SIZE_MAX ((size_t) -1)
lib/iconvme.c:# define SIZE_MAX ((size_t) -1)
lib/mountlist.c:# define SIZE_MAX ((size_t) -1)
lib/quotearg.c:# define SIZE_MAX ((size_t) -1)
lib/readutmp.c:# define SIZE_MAX ((size_t) -1)
lib/regex_internal.h:# define SIZE_MAX ((size_t) -1)
lib/stdint_.h:#define SIZE_MAX (~(size_t)0)
lib/utimecmp.c:# define SIZE_MAX ((size_t) -1)
lib/xmalloc.c:# define SIZE_MAX ((size_t) -1)
lib/xreadlink.c:# define SIZE_MAX ((size_t) -1)
address@hidden gnulib]$


Incidentally, the "#define SIZE_MAX (~(size_t)0)" in lib/stdint_.h may
not be portable:
<http://lists.gnu.org/archive/html/bug-gnulib/2004-03/msg00022.html>.

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<mailto:address@hidden>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]