From: Artem Bityutskiy <dedekind1@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: linux-mtd@lists.infradead.org,
Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Subject: Re: [PATCHv2 2/2] mkfs.jffs2: fix casting of __off64_t
Date: Mon, 18 Apr 2011 17:07:26 +0300 [thread overview]
Message-ID: <1303135646.8589.12.camel@localhost> (raw)
In-Reply-To: <BANLkTi=7yxRMgw+UpCZ+bmwrQw_QfFT44A@mail.gmail.com>
On Mon, 2011-04-18 at 10:04 -0400, Mike Frysinger wrote:
> On Mon, Apr 18, 2011 at 09:55, Artem Bityutskiy wrote:
> > On Mon, 2011-04-18 at 09:49 -0400, Mike Frysinger wrote:
> >> On Mon, Apr 18, 2011 at 04:31, Andy Shevchenko wrote:
> >> > The casting of __off64_t to unsigned long potentially wrong for values higher
> >> > than ULONG_MAX. Let's fix that.
> >>
> >> i dont think this is the way to go. on 64bit systems, long long is
> >> 128bits. i imagine the way to go (assuming we're always using LFS) is
> >> to use PRIu64 from inttypes.h
> >
> > sizeof(unsigned long long) is 8 (64 bits) on my x86_64 fedora.
>
> so it is. i still think PRIu64 is the correct way to handle this as
> there is no sizeof() assumption and no need for casting.
Never used this, but yes, as long as this is something which has worked
for ages and we are not going to have "this is not supported" issues -
sure!
But unsigned long long is 64 bits I think in all GNU systems, and
casting to unsigned long long is quite standard practice AFAIK, so I do
not see why it would be very bad thing to do.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2011-04-18 14:10 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 13:20 [PATCHv1 1/5] mkfs.jffs2: fix casting of printf argument Andy Shevchenko
2011-04-13 13:20 ` [PATCHv1 2/5] serve_image: adjust type for printf Andy Shevchenko
2011-04-14 12:25 ` Artem Bityutskiy
2011-04-13 13:20 ` [PATCHv1 3/5] tests: fs-tests: read() returns ssize_t value Andy Shevchenko
2011-04-14 12:26 ` Artem Bityutskiy
2011-04-13 13:20 ` [PATCHv1 4/5] tests: checkfs: adjust Makefile Andy Shevchenko
2011-04-14 12:28 ` Artem Bityutskiy
2011-04-13 13:20 ` [PATCHv1 5/5] tests: ubi-tests: clean libubi.a and *.o Andy Shevchenko
2011-04-14 12:30 ` Artem Bityutskiy
2011-04-14 12:24 ` [PATCHv1 1/5] mkfs.jffs2: fix casting of printf argument Artem Bityutskiy
2011-04-14 13:21 ` Andy Shevchenko
2011-04-18 8:31 ` [PATCHv2 1/2] serve_image: adjust classificator and type for printf Andy Shevchenko
2011-04-18 8:31 ` [PATCHv2 2/2] mkfs.jffs2: fix casting of __off64_t Andy Shevchenko
2011-04-18 13:49 ` Mike Frysinger
2011-04-18 13:55 ` Artem Bityutskiy
2011-04-18 14:04 ` Mike Frysinger
2011-04-18 14:07 ` Artem Bityutskiy [this message]
2011-04-18 14:21 ` Mike Frysinger
2011-04-18 14:29 ` Artem Bityutskiy
2011-04-18 14:26 ` Andy Shevchenko
2011-04-18 14:29 ` Mike Frysinger
2011-04-18 14:50 ` Andy Shevchenko
2011-04-18 14:57 ` Mike Frysinger
2011-04-18 15:20 ` Andy Shevchenko
2011-04-18 21:33 ` Mike Frysinger
2011-04-19 6:43 ` Artem Bityutskiy
2011-04-19 8:34 ` [PATCHv3 1/3] " Andy Shevchenko
2011-04-19 8:34 ` [PATCHv3 2/3] libmtd: use PRIu64 classifier for uint64_t printf arguments Andy Shevchenko
2011-04-19 8:34 ` [PATCHv3 3/3] serve_image: adjust classifier and type for printf Andy Shevchenko
2011-04-19 14:26 ` Mike Frysinger
2011-04-19 14:32 ` Andy Shevchenko
2011-04-19 21:54 ` Mike Frysinger
2011-04-20 9:35 ` [PATCHv4 1/3] mkfs.jffs2: fix casting of __off64_t Andy Shevchenko
2011-04-20 9:35 ` [PATCHv4 2/3] libmtd: use PRIu64 classifier for uint64_t printf arguments Andy Shevchenko
2011-04-20 9:35 ` [PATCHv4 3/3] serve_image: adjust classifier and type for printf Andy Shevchenko
2011-04-20 19:04 ` [PATCHv4 1/3] mkfs.jffs2: fix casting of __off64_t Mike Frysinger
2011-04-21 12:53 ` Artem Bityutskiy
2011-04-21 17:09 ` [PATCH] serve_image: missing comma Brian Norris
2011-04-22 7:38 ` Artem Bityutskiy
2011-04-19 14:26 ` [PATCHv3 1/3] mkfs.jffs2: fix casting of __off64_t Mike Frysinger
2011-04-19 14:29 ` Andy Shevchenko
2011-04-19 14:38 ` Mike Frysinger
2011-04-19 14:42 ` Andy Shevchenko
2011-04-18 13:50 ` [PATCHv2 1/2] serve_image: adjust classificator and type for printf Mike Frysinger
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=1303135646.8589.12.camel@localhost \
--to=dedekind1@gmail.com \
--cc=ext-andriy.shevchenko@nokia.com \
--cc=linux-mtd@lists.infradead.org \
--cc=vapier.adi@gmail.com \
/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).