From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10375 invoked by alias); 15 Mar 2004 22:18:28 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10368 invoked from network); 15 Mar 2004 22:18:28 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 15 Mar 2004 22:18:28 -0000 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id AACCC2FEDCF; Mon, 15 Mar 2004 23:18:27 +0100 (CET) To: Christian Groessler Cc: Ian Lance Taylor , GCC List Subject: Re: signed/unsigned right shift References: <87ish53h24.fsf@aladdin.de> From: Andreas Schwab X-Yow: Hey!! Let's watch the' ELEVATOR go UP and DOWN at th' HILTON HOTEL!! Date: Mon, 15 Mar 2004 22:18:00 -0000 In-Reply-To: (Andreas Schwab's message of "Mon, 15 Mar 2004 23:14:44 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-03/txt/msg00747.txt.bz2 Andreas Schwab writes: > Christian Groessler writes: > >> But sentence 3 says "The integer promotions preserve value including >> sign." >> >> So shouldn't the conversion be "unsigned short" to "unsigned int"? > > No, it just says that the _value_ is preserved. It doesn't say anything > about the type. That's one of the key difference between K&R C and ISO > C: type preservation vs. value preservation. s/type preservation/unsigned preservation/ Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."