From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.162]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 6f641357; for ; Tue, 10 Mar 2015 20:18:07 -0500 (EST) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylsiW+oaSMR X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-45-1-68.web.vodafone.de [109.45.1.68]) by smtp.strato.de (RZmta 37.3 DYNA|AUTH) with ESMTPSA id Z0353er2B1I5Vjh (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) for ; Wed, 11 Mar 2015 02:18:05 +0100 (CET) Received: by britannica.bec.de (sSMTP sendmail emulation); Wed, 11 Mar 2015 02:18:01 +0100 Date: Wed, 11 Mar 2015 02:18:01 +0100 From: Joerg Sonnenberger To: tech@mdocml.bsd.lv Subject: Re: mdocml: The st_size member of struct stat is off_t, which is signed, all Message-ID: <20150311011801.GA22191@britannica.bec.de> Mail-Followup-To: tech@mdocml.bsd.lv References: <1281237932347383369.enqueue@fantadrom.bsd.lv> <20150310214738.GA20964@britannica.bec.de> <20150311011032.GB22101@athene.usta.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150311011032.GB22101@athene.usta.de> User-Agent: Mutt/1.5.21 (2010-09-15) On Wed, Mar 11, 2015 at 02:10:32AM +0100, Ingo Schwarze wrote: > [ Moving this to tech@ ] > > Hi Joerg, > > 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. Joerg -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv