git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Support sizes >=2G in various config options accepting 'g' sizes.

From
Nix <nix@esperi.org.uk>
Date
Sep 6, 2011, 10:25 UTC
Message-ID
<87liu2j7c3.fsf@spindle.srvr.nix>
In-Reply-To
<4E65F451.4070900@viscovery.net>
On 6 Sep 2011, Johannes Sixt verbalised:
> Why so? strtol() can report overflow:
... it can?!
>     ...
>     If the correct value is outside the range of representable values,
> {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned
> (according to the sign of the value), and errno set to [ERANGE].

I've been using it for longer than I care to imagine and I've never once noticed that.

OK, I'll add range checking support then! following which we can detect config value overflow on the most pathetic platform imaginable, except that such a platform would probably not bother to set ERANGE properly ;}

Fixed patch following later today ripping out the STRTOMAX renaming and adding proper range checking.

-- 
NULL && (void)
Previous: Johannes SixtNext: Johannes Sixt
Message 8 of 12 in “Add strtoimax() compatibility function.”
  1. 1/2 Add strtoimax() compatibility function.Nix, Sep 5, 2011
  2. 2/2 Support sizes >=2G in various config options accepting 'g' sizes.Nix, Sep 5, 2011
  3. Sverre RabbelierSep 5, 2011
  4. NixSep 5, 2011
  5. Clemens BuchacherSep 6, 2011
  6. NixSep 6, 2011
  7. Johannes SixtSep 6, 2011
  8. NixSep 6, 2011
  9. Johannes SixtSep 6, 2011
  10. NixSep 6, 2011
  11. Junio C HamanoSep 6, 2011
  12. NixSep 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.