From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 5BE1D2FA9F for ; Tue, 26 Sep 2000 12:02:36 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.8.7/8.8.7) id MAA16510 for axp-list@listman.redhat.com; Tue, 26 Sep 2000 12:02:36 -0400 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id MAA16505 for ; Tue, 26 Sep 2000 12:02:35 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.9.3/8.9.3) id KAA11797 for axp-list@redhat.com; Tue, 26 Sep 2000 10:02:28 -0600 From: Michal Jaegermann Message-Id: <200009261602.KAA11797@ellpspace.math.ualberta.ca> Subject: Re: Weird Compaq CCC / GCC interaction ? To: axp-list@redhat.com Date: Tue, 26 Sep 2000 10:02:27 -0600 (MDT) In-Reply-To: <20000926111252.A17671@snowball.ucd.ie> from "Nikita Schmidt" at Sep 26, 2000 11:12:52 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors > > According to the Calling Standard for Alpha Systems, Section 4.1.5 "Unused > Bits in Passed Data," both signed and unsigned ints should be passed > sign-extended in registers. Good to know but why this convention? If I follow implications correctly (which is a big IF) then if I take results of such function returning unsigned int, like in the example, and will cast its result to long then I may get a negative number. OTOH if I do: #define MAGIC 0xc00fc00fU ... printf ("%ld\n", (long)MAGIC); ... then result is positive and I would be quite surprised otherwise. Or this Standard makes this also into a bug and expects that the cast above is equivalent to (long)((int)MAGIC)? If yes then again why? Michal