linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.5-mc2
Date: Wed, 7 Apr 2004 11:52:47 -0700	[thread overview]
Message-ID: <20040407115247.701ae24a.akpm@osdl.org> (raw)
In-Reply-To: <20040407183416.GC30117@holomorphy.com>

William Lee Irwin III <wli@holomorphy.com> wrote:
>
> On Wed, Apr 07, 2004 at 11:27:38AM -0700, Andrew Morton wrote:
> > I did it this way, relying on magical promotions:
> > --- 25/fs/open.c~nfs-32bit-statfs-fix-warning-fix	2004-04-06 23:16:25.221685072 -0700
> > +++ 25-akpm/fs/open.c	2004-04-06 23:16:25.225684464 -0700
> > @@ -64,10 +64,10 @@ static int vfs_statfs_native(struct supe
> >  			 * f_files and f_ffree may be -1; it's okay to stuff
> >  			 * that into 32 bits
> >  			 */
> > -			if (st.f_files != 0xffffffffffffffffULL &&
> > +			if (st.f_files != -1 &&
> >  			    (st.f_files & 0xffffffff00000000ULL))
> >  				return -EOVERFLOW;
> > -			if (st.f_ffree != 0xffffffffffffffffULL &&
> > +			if (st.f_ffree != -1 &&
> >  			    (st.f_ffree & 0xffffffff00000000ULL))
> 
> Are you sure this works? IIRC -1 is promoted only afterward, yielding
> on 64-bit (1UL << 32) - 1 instead of ~0UL, which was the issue with
> init_task.cpus_allowed being initialized to -1 on 2.4.x. Maybe it's
> better behaved in this instance (language lawyer territory).


This says yes:

main()
{
	unsigned long long ll = 0xffffffffffffffff;

	if (ll == -1)
		printf("yes\n");
}

The compiler has ((int)-1) and then has to promote it to ULL.  If it does
the conversion to unsigned before the conversion to long long, we lose. 
But it doesn't, and I couldn't immediately find a spec which justfies this
behaviour.


  reply	other threads:[~2004-04-07 18:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07  5:17 2.6.5-mc2 Andrew Morton
2004-04-07 15:29 ` 2.6.5-mc2 (compile stats) John Cherry
2004-04-07 16:12   ` John Cherry
2004-04-07 16:06 ` 2.6.5-mc2 Gerd Knorr
2004-04-07 18:04 ` 2.6.5-mc2 William Lee Irwin III
2004-04-07 18:09   ` 2.6.5-mc2 William Lee Irwin III
2004-04-07 18:27     ` 2.6.5-mc2 Andrew Morton
2004-04-07 18:34       ` 2.6.5-mc2 William Lee Irwin III
2004-04-07 18:52         ` Andrew Morton [this message]
2004-04-07 19:27           ` 2.6.5-mc2 William Lee Irwin III

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=20040407115247.701ae24a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.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).