bug-coreutils
[Top][All Lists]
Advanced

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

Re: size_t option parsing question


From: Paul Eggert
Subject: Re: size_t option parsing question
Date: Thu, 28 Sep 2006 09:48:57 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> writes:

> POSIX also states that size_t is only guaranteed to be 16 bits.

Really?  Where?  Anyway, this is not an issue for coreutils, since the
GNU coding standards say:

  However, don't make any effort to cater to the possibility that an
  @code{int} will be less than 32 bits.  We don't support 16-bit machines
  in GNU.

and a reasonable corollary is that you can assume that size_t is at
least 32 bits.

> Second, POSIX does not always guarantee that size_t fits in a long.

Again, the GNU coding standards come to your rescue:

  Similarly, don't make any effort to cater to the possibility that
  @code{long} will be smaller than predefined types like @code{size_t}.


> Next, there is still a big FIXME in xstrtol debating whether the API
> should be changed slightly and all callers updated, so that clients
> of xstrtol can easily get suffix parsing by passing in NULL instead
> of a long list of letters.  The longer we wait to resolve this API,
> the more projects will be impacted by a change.

Yes, that's true.

> And would size_opt be useful in gnulib, alongside xstrtol, rather than 
> buried in uniq.c?

Might be, yes.

> Finally, it looks like suffix parsing is a purely upward compatible extension 
> to POSIX in many cases.

Yes, that's true too.




reply via email to

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