From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] another compiler bug (another try to send this coherently) From: rog@vitanuova.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010716110323.EE998199C1@mail.cse.psu.edu> Date: Mon, 16 Jul 2001 12:13:04 +0100 Topicbox-Message-UUID: ced5af70-eac9-11e9-9e20-41e7f4b1d025 > 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 #include int main(void) { static unsigned char tab[1] = { 0x80 }; char *z; z = tab[0] << 24 >> 31; }