From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01-web.scc.kit.edu (scc-mailout-kit-01-web.scc.kit.edu [129.13.231.93]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 3bb007a1; for ; Wed, 11 Mar 2015 08:30:34 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (envelope-from ) id 1YVgiW-0003X3-6F; Wed, 11 Mar 2015 14:30:33 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1YVgiW-0005wn-0v; Wed, 11 Mar 2015 14:30:32 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.80) (envelope-from ) id 1YVgiV-00038j-SG; Wed, 11 Mar 2015 14:30:31 +0100 Received: from localhost (1031@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id 6dc44b0d; Wed, 11 Mar 2015 14:30:31 +0100 (CET) Date: Wed, 11 Mar 2015 14:30:31 +0100 From: Ingo Schwarze To: Joerg Sonnenberger Cc: tech@mdocml.bsd.lv Subject: Re: mdocml: The st_size member of struct stat is off_t, which is signed, all Message-ID: <20150311133031.GE11211@athene.usta.de> References: <1281237932347383369.enqueue@fantadrom.bsd.lv> <20150310214738.GA20964@britannica.bec.de> <20150311011032.GB22101@athene.usta.de> <20150311011801.GA22191@britannica.bec.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: <20150311011801.GA22191@britannica.bec.de> User-Agent: Mutt/1.5.23 (2014-03-12) 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