From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <022b01c10e30$34a40cb0$3cf7c6d4@SOMA> From: "Boyd Roberts" To: <9fans@cse.psu.edu> References: <200107161921.f6GJL7c10659@ducky.net> Subject: Re: [9fans] another compiler bug (another try to send this coherently) MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Date: Mon, 16 Jul 2001 21:47:54 +0200 Topicbox-Message-UUID: cf43b740-eac9-11e9-9e20-41e7f4b1d025 From: "Mike Haertel" > I'm not actually trying to do anything that depends on this. > I have been writing some high-performance AES (Rijndael) encryption > routines lately. yeah, i know what AES is. > I decided the portability problems associated > with relying on compilers getting the ANSI C rules exactly right > were too much of a headache, so I went through the code to put in > explicit casts anywhere implicit conversions would otherwise occur, > to prevent broken compilers (like 8c) from doing the Wrong Thing. ahh, that little tin god efficiency. why didn't you _write_ the code that way in the first place? > I was reviewing my code, with the help of "8c -t" to print the > parse trees and make sure there were no implicit promotions left, > when I stumbled across a few more I had overlooked, and noticed > moreover that 8c was inserting "CAST UINT" in places where ANSI > says it should have inserted "CAST INT". So I reported it as a bug. don't you think that posting the above paragraph would have more useful? > It wasn't causing me any trouble, it did, by your own admission. > but I think these things should be fixed whenever you find them. sure, but, i'm not sure plan 9 gets it _wrong_. doug will probably disagree, but i know why. i guess the ANSI reasoning went: chars get promoted to int. trouble is that whether they where signed or not was undefined, so they all got promoted to int. i think this is wrong. they should have preserved their unsigned property if they were declared as unsigned. in a char decl, well make a choice: - make it implementation dependant - declare 'em to be signed by definition language law -- i hate it.