Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 7/17/84; site ur-valhalla.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!hao!seismo!rochester!ur-valhalla!root From: root@ur-valhalla.UUCP Newsgroups: net.lang.c,net.bugs.4bsd Subject: Re: C compiler bug (I think). [Contains fix <- NOT QUITE] Message-ID: <74@ur-valhalla.UUCP> Date: Mon, 27-Aug-84 16:57:42 EDT Article-I.D.: ur-valha.74 Posted: Mon Aug 27 16:57:42 1984 Date-Received: Thu, 30-Aug-84 09:49:51 EDT References: <73@ur-valhalla.UUCP> <8164@umcp-cs.UUCP>, <3009@utah-cs.UUCP> Organization: U. of Rochester, EE Dept. Lines: 23 Well, I've installed Donn Seeley's fix for the C compiler screwing up on initializing shifted, unsigned variables, and found out a nasty side effect: The (unsigned) cast is IGNORED! This is my program: main() { int big_number = ((~((unsigned) 0)) >> 1); printf("this is a big number: %d\n",big_number); } Before installing the fix the program produced this output: this is a big number: 2147483647 (To remind the original problem: should big_number be declared as static or as a global variable, C compiler would blow up and go into a loop). After installing the fix, I got the following output: this is a big number: -1 Sigh.... -- Krzysztof Kozminski (truly sorry for not being able to fix the problem myself) {seismo,allegra,decvax}!rochester!ur-valhalla!kris