From: Albert Cahalan <albert@users.sf.net>
To: davidm@hpl.hp.com
Cc: Albert Cahalan <albert@users.sourceforge.net>,
linux-kernel mailing list <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>,
Andrew Morton OSDL <akpm@osdl.org>
Subject: Re: [patch] u64 casts
Date: 27 Feb 2004 17:16:53 -0500 [thread overview]
Message-ID: <1077920213.2233.44.camel@cube> (raw)
In-Reply-To: <16447.56941.774257.925722@napali.hpl.hp.com>
On Fri, 2004-02-27 at 19:18, David Mosberger wrote:
> >>>>> On 27 Feb 2004 15:58:42 -0500, Albert Cahalan <albert@users.sourceforge.net> said:
>
> Albert> Casts are considered harmful, because they bypass
> Albert> type checking, but how do you print a u64 value?
> Albert> You cast it to "unsigned long long" like this:
>
> Albert> printk("%llu\n", (unsigned long long)foo);
>
> Albert> Well, this is silly and ugly. As x86-64 has shown,
> Albert> even a 64-bit port can use "long long" for 64-bit
> Albert> values. This patch changes all other 64-bit ports.
> Albert> It now becomes possible to avoid adding new casts
> Albert> all over the place; existing ones may be removed
> Albert> if so desired.
>
> Did you verify that none of the kernel header files that are still
> being used by glibc contain declarations based on __u64 or __s64? If
> not, your patch breaks user-level code.
Supposing that this is the case, you may get warnings.
Well, good, maybe somebody will fix glibc. The data
types are obviously the same size, so no data-corrupting
errors will result.
Note that x86-64, a 64-bit port using glibc, is just
fine with "long long" already.
Also note that /usr/include/asm is a modified copy of
kernel headers. It won't be suddenly changing as a
result of the patch, even after a kernel upgrade.
(the symlink hasn't been OK since libc5 days)
next prev parent reply other threads:[~2004-02-28 0:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-27 20:58 [patch] u64 casts Albert Cahalan
2004-02-28 0:18 ` David Mosberger
2004-02-27 22:16 ` Albert Cahalan [this message]
2004-02-28 0:45 ` David Mosberger
2004-02-27 22:53 ` Albert Cahalan
2004-02-28 7:44 ` David S. Miller
2004-02-28 10:42 ` Jakub Jelinek
2004-02-28 14:46 ` [patch] new version, u64 cast avoidance Albert Cahalan
2004-02-28 23:58 ` Benjamin Herrenschmidt
2004-02-28 23:59 ` Benjamin Herrenschmidt
2004-02-28 22:21 ` Albert Cahalan
2004-02-29 1:08 ` Benjamin Herrenschmidt
2004-02-28 23:49 ` Albert Cahalan
2004-02-29 3:25 ` Matt Mackall
2004-02-29 1:01 ` [patch] 3rd " Albert Cahalan
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=1077920213.2233.44.camel@cube \
--to=albert@users.sf.net \
--cc=akpm@osdl.org \
--cc=albert@users.sourceforge.net \
--cc=davidm@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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