Re: [PATCH 2/2] Support sizes >=2G in various config options accepting 'g' sizes.
- From
Clemens Buchacher <drizzd@aon.at>
- Date
- Sep 6, 2011, 07:44 UTC
- Message-ID
- <20110906074421.GB28490@ecki>
- In-Reply-To
- <87ty8rm6th.fsf@spindle.srvr.nix>
On Mon, Sep 05, 2011 at 02:56:10PM +0100, Nix wrote:
Show 11 quoted lines
> > Well, we're parsing longs, not ints. If sizeof(long)>sizeof(int), or we > have long long and sizeof(long long)>sizeof(int), then we can always > detect overflows when saving into the appropriate type: but if we don't > have long long, or if we have neither strto(u)ll() nor strto[ui]max(), > we could only detect overflow by looking at the raw text string and > checking it by hand to see if it would fit. I judged this pointless > extra complexity for a very rare edge case (machines with neither > strot(u)ll() nor strto[ui]max() are generally quite old and people > aren't going to be specifying sizes in gigabytes on such machines > anyway.)
Is this also true for Windows and other platforms?
And I don't think it's about whether or not people are likely to specify sizes in gigabytes on old machines. People are bound to blindly copy configuration files from one machine to another. In any case, my expectation would be for the configuration options to do what I tell them, or error out if they do not make sense.
Clemens