From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 22 Apr 2010 23:26:09 +0200 From: tlaronde@polynum.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20100422212609.GA2513@polynum.com> References: <20100422175033.GA6247@polynum.com> <87d97130a41364706523e641fe0dd372@plan9.bell-labs.com> <20100422193236.GA2388@polynum.com> <20100422200740.49F7D5B73@mail.bitblocks.com> <20100422211551.GA987@polynum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100422211551.GA987@polynum.com> User-Agent: Mutt/1.4.2.3i Subject: Re: [9fans] BUG!!! in Plan9 compiler! Topicbox-Message-UUID: 0c73b244-ead6-11e9-9d60-3106f5b1d025 On Thu, Apr 22, 2010 at 11:15:51PM +0200, tlaronde@polynum.com wrote: > > I get: > > gcc: -201 > ken-cc: 2147483447 (2^31 - 201) > > This is: signed long + signed long + unsigned char. > > Do you mean that there is first promotion : > > 1) unsigned char is promoted to unsigned int (A6.1). > > 2) And since there is an arithmetic operator (/ or shift), > unsigned int value may exceeds signed long == signed int, the > signed long is converted to unsigned long (A6.2)? > > Is it this?!!!!? > > And when I do first assignment, there is only promotion (since no > operator is here). Yielding the correct value in x2, that is then > divided (or shifted) by 2, hence signed, and no problem? I say non-sense: even in the assignment, there is still arithmetic conversions: the '+'... I don't get it... -- Thierry Laronde http://www.kergis.com/ Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C