All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@phunq.net>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	tux3@tux3.org, linux-kernel@vger.kernel.org
Subject: Re: [Tux3] Tux3 report: Tux3 Git tree available
Date: Sat, 14 Mar 2009 20:36:50 -0700	[thread overview]
Message-ID: <200903142036.50335.phillips@phunq.net> (raw)
In-Reply-To: <87ljraof5u.fsf@devron.myhome.or.jp>

On Thursday 12 March 2009, OGAWA Hirofumi wrote:
> Daniel Phillips <phillips@phunq.net> writes:
> >> > > - What's "L"?
> >> > > 
> >> > > 		printf("%Lx-", (L)begin);
> >> > 
> >> > A very handy way of working around 32/64 bit format string issues.  We
> >> > just cast all the messy cases to (long long), aka (L).  All other
> >> > solutions to this messy problem are worse in my opinion, but whatever
> >> > the ruling is, is what we will do.  This is used heavily in tracing and
> >> > dumping code, which can all be turned off with ifdefs, so it doesn't
> >> > affect production kernel text.
> >> 
> >> What format string issues are we talking about here?
> >> 
> >> See, a number of them will be fixed real soon now (geologically
> >> speaking) when various 64-bit architectures switch their s64/u64
> >> implementation from `long' to `long long'.
> >
> > Ah, that would be helpful.  But not done yet?  How long until it
> > happens, and does it make sense to wait, so we can reduce the number
> > of problems cases?  And... will it be all 64 bit arches or just some?
> > Because this issue isn't solved if it isn't fixed for all arches.
> >
> > There are a couple of issues, one is u64 being (long) instead of
> > (long long) as you say, and the other is variable type sizes like
> > loff_t.  That specific one isn't actually a problem, we can just refuse
> > to support 32 bit libc file ops, but there may be others.  We had a
> > world of pain before (L) arrived, then with (L) it was easy.  Maybe
> > just edit them all to (long long) for now, and damn the line length.
> 
> BTW, those are almost because of userland issue. Kernel are more and
> more using same type. But, glibc is not. And we (tux3) are sharing the
> same code with kernel and userland. Some types are depending to
> CONFIG_*, so if we have generic cast type like (L).
> 
> [The fatfs also has own type (llu), if it become generic, fatfs will
> also be happy.]
> 
> Thanks.

Maybe we should argue for some generic flavor of the (L)/(llu) idea
then.  I suppose we should figure out exactly how much of our usage
will remain after the kernel issue is resolved.  One small thing we
could do is make it a typedef instead of a macro.  And spelling it
out completely as (long long) is not so bad, except it loses the
desirable property of being able to grep for the messy thing, and
adds a painful amount of useless line length, given how frequently
the issue shows up.

Regards,

Daniel

  reply	other threads:[~2009-03-15  3:37 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 16:25 Tux3 report: Tux3 Git tree available Daniel Phillips
2009-03-11 18:42 ` Andrew Morton
2009-03-12  5:38   ` [Tux3] " Daniel Phillips
2009-03-12  6:07     ` Andrew Morton
2009-03-12  8:33       ` Daniel Phillips
2009-03-12  8:47         ` Nick Piggin
2009-03-12  9:00           ` Daniel Phillips
2009-03-12  9:10             ` Nick Piggin
2009-03-12 10:15               ` Daniel Phillips
2009-03-12 11:03                 ` Nick Piggin
2009-03-12 12:24                   ` Daniel Phillips
2009-03-12 12:32                     ` Matthew Wilcox
2009-03-12 12:45                       ` Nick Piggin
2009-03-12 12:45                         ` Nick Piggin
2009-03-12 13:12                         ` [Tux3] " Daniel Phillips
2009-03-12 13:06                       ` Daniel Phillips
2009-03-12 13:04                     ` Nick Piggin
2009-03-12 13:04                       ` Nick Piggin
2009-03-12 13:59                       ` [Tux3] " Matthew Wilcox
2009-03-12 14:19                         ` Nick Piggin
2009-03-15  3:24                         ` Daniel Phillips
2009-03-15  3:24                           ` Daniel Phillips
2009-03-15  3:50                           ` [Tux3] " Nick Piggin
2009-03-15  4:08                             ` Daniel Phillips
2009-03-15  4:08                               ` Daniel Phillips
2009-03-15  4:14                               ` [Tux3] " Nick Piggin
2009-03-15  2:41                       ` Daniel Phillips
2009-03-15  3:45                         ` Nick Piggin
2009-03-15 21:44                           ` Theodore Tso
2009-03-15 22:41                             ` Daniel Phillips
2009-03-16 10:32                               ` Nick Piggin
2009-03-16  5:12                             ` Dave Chinner
2009-03-16  5:12                               ` Dave Chinner
2009-03-16  6:38                               ` Theodore Tso
2009-03-16  6:38                                 ` Theodore Tso
2009-03-16 10:14                                 ` Nick Piggin
2009-03-16 10:14                                   ` Nick Piggin
2009-03-12 17:06                   ` [Tux3] " Theodore Tso
2009-03-13  9:32                     ` Nick Piggin
2009-03-12 17:00           ` OGAWA Hirofumi
2009-03-15  3:54             ` Daniel Phillips
2009-03-12  9:47         ` Sam Ravnborg
2009-03-12 10:25           ` Daniel Phillips
2009-03-12 15:30         ` Diego Calleja
2009-03-12 16:54         ` OGAWA Hirofumi
2009-03-15  3:36           ` Daniel Phillips [this message]
2009-03-15  4:26             ` OGAWA Hirofumi
2009-03-12 13:24       ` Andi Kleen
2009-03-12 21:24         ` [Tux3] " Daniel Phillips
2009-03-12 23:38           ` Andi Kleen
2009-03-15  3:03             ` Daniel Phillips
2009-03-12 21:02     ` Roland Dreier
2009-03-15  4:02       ` Daniel Phillips
2009-03-12 16:18   ` OGAWA Hirofumi
2009-03-12 20:02     ` Andrew Morton
2009-03-12 20:46       ` OGAWA Hirofumi
2009-03-15  3:58         ` Daniel Phillips

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=200903142036.50335.phillips@phunq.net \
    --to=phillips@phunq.net \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tux3@tux3.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.