9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: lucio@proxima.alt.za (Lucio De Re)
Subject: [9fans] 8c puzzling behavior
Date: Tue,  8 Mar 2011 19:43:02 +0200	[thread overview]
Message-ID: <ff0671e532623bdb5a28a7fd6a08f07e@proxima.alt.za> (raw)
In-Reply-To: <828637c0a3c0883a51747d7b9d310a81@ladd.quanstro.net>

>> so it seems clear that constants are treated as if unsigned, regardless,
>> but variables are not?
> 
> the really wierd bit is that the 1 in 1<<i suddenly becomes signed,
> even though other constants are treated as if unsigned, and i is
> unsigned.
> 
I would not hesitate to call that a bug.

I would also strongly advise you to leave well enough alone and not
rely on what the standard calls implementation choices for any code
you would like to be portable.  If it doesn't have to be portable,
check the compiler behaviour; then, as R.A. Heinlein would have it,
"revel in it".

++L




  reply	other threads:[~2011-03-08 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 17:21 erik quanstrom
2011-03-08 17:43 ` Lucio De Re [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-03-08 17:16 erik quanstrom
2011-03-08 20:21 ` geoff at plan9.bell-labs.com
2011-03-08 23:32 ` Bakul Shah
2011-03-08 23:54   ` erik quanstrom
2011-03-09  7:23     ` Charles Forsyth
2011-03-09 13:05       ` erik quanstrom

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=ff0671e532623bdb5a28a7fd6a08f07e@proxima.alt.za \
    --to=lucio@proxima.alt.za \
    /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).