9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] another compiler bug (another try to send this coherently)
Date: Mon, 16 Jul 2001 12:13:04 +0100	[thread overview]
Message-ID: <20010716110323.EE998199C1@mail.cse.psu.edu> (raw)

> How do you figure that?  The promoted tab[0] (signed int) or x
> left-shifted 24 places sets the sign bit, and right-shifting a
> negative value is implementation-defined.

implementation-defined implies the result is at least consistent across
a particular implementation.  the example that was given shows that
that isn't the case (if the unsigned char is indeed being promoted to
signed int, which it isn't, as the compiler error messages for the
following code imply:)

#include <u.h>
#include <libc.h>

int
main(void)
{
         static unsigned char tab[1] = { 0x80 };
	char *z;
	z = tab[0] << 24 >> 31;
}



             reply	other threads:[~2001-07-16 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16 11:13 rog [this message]
2001-07-16 12:51 ` Boyd Roberts
2001-07-16 13:41   ` Boyd Roberts
2001-07-16 13:44   ` Boyd Roberts
  -- strict thread matches above, loose matches on Subject: below --
2001-07-17 15:51 forsyth
2001-07-18  8:43 ` Douglas A. Gwyn
2001-07-14  3:26 Mike Haertel
2001-07-16  9:05 ` Douglas A. Gwyn
2001-07-16  9:38   ` Boyd Roberts
2001-07-16 18:34   ` Mike Haertel
2001-07-16 18:52     ` Boyd Roberts
2001-07-16 19:21       ` Mike Haertel
2001-07-16 19:47         ` Boyd Roberts
2001-07-17 15:16         ` Douglas A. Gwyn

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=20010716110323.EE998199C1@mail.cse.psu.edu \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /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).