From: Ingo Schwarze <schwarze@usta.de>
To: Joerg Sonnenberger <joerg@britannica.bec.de>
Cc: tech@mdocml.bsd.lv
Subject: Re: mdocml: The st_size member of struct stat is off_t, which is signed, all
Date: Wed, 11 Mar 2015 14:30:31 +0100 [thread overview]
Message-ID: <20150311133031.GE11211@athene.usta.de> (raw)
In-Reply-To: <20150311011801.GA22191@britannica.bec.de>
Hi Joerg,
Joerg Sonnenberger wrote on Wed, Mar 11, 2015 at 02:18:01AM +0100:
> On Wed, Mar 11, 2015 at 02:10:32AM +0100, Ingo Schwarze wrote:
>> Joerg Sonnenberger wrote on Tue, Mar 10, 2015 at 10:47:38PM +0100:
>>> On Tue, Mar 10, 2015 at 09:18:22AM -0500, schwarze@mdocml.bsd.lv wrote:
>>>> Log Message:
>>>> -----------
>>>> The st_size member of struct stat is off_t, which is signed,
>>>> all required by POSIX. So don't compare it against against
>>>> an unsigned constant.
>>> Well, the change truncates the value.
>> How so? The actual width of size_t will hardly be narrower
>> than the width of off_t on any sane platform, or am i mistaken?
> Most 32bit platforms are exactly like that. size_t will be 32bit, off_t
> will be 64bit. So casting the off_t to size_t will rip out the higher
> bits.
Indeed, i misread header files.
So i changed the line in the way you proposed.
Thanks for the cluestick!
Ingo
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
prev parent reply other threads:[~2015-03-11 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1281237932347383369.enqueue@fantadrom.bsd.lv>
[not found] ` <20150310214738.GA20964@britannica.bec.de>
2015-03-11 1:10 ` Ingo Schwarze
2015-03-11 1:18 ` Joerg Sonnenberger
2015-03-11 13:30 ` Ingo Schwarze [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150311133031.GE11211@athene.usta.de \
--to=schwarze@usta.de \
--cc=joerg@britannica.bec.de \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).