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 D3AA62F001 for ; Tue, 9 Jan 2001 13:01:11 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f09I1Br16043 for axp-list@listman.redhat.com; Tue, 9 Jan 2001 13:01:11 -0500 Received: from taarna.sector7.com (taarna.sector7.com [216.166.14.10]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f09I1BD16037 for ; Tue, 9 Jan 2001 13:01:11 -0500 Received: (from chris@localhost) by taarna.sector7.com (8.9.3/8.9.3) id MAA15671 for axp-list@redhat.com; Tue, 9 Jan 2001 12:05:11 -0600 Date: Tue, 9 Jan 2001 12:05:11 -0600 From: "Chris Eleveld (Sector 7 Group)" To: axp-list@redhat.com Subject: Re: ccc error [OT] Message-ID: <20010109120511.N19919@taarna.sector7.com> References: <000f01c07a43$3f7b0c00$8cf8fea9@hptilap.hpti.com> <3A5B4184.37986642@appnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4us In-Reply-To: <3A5B4184.37986642@appnet.com>; from Jeff Sturm on Tue, Jan 09, 2001 at 11:51:16AM -0500 X-Fortune: Polymer physicists are into chains. 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 ANSI/ISO C forbids a non-modifiable L value. Its a very common extension to allow however. When we upgraded to the latest AIX compilers we saw the same error in much of our code. The reason is much the same as: int main(int argc, char **argv) { int i; char *c; /* follow is in error */ (int *)c = &i; /* however the follwoing is correct */ c = (char *)&i; return 0; } On Tue, Jan 09, 2001 at 11:51:16AM -0500, Jeff Sturm wrote: > Greg Lindahl wrote: > > > void f(int x) { > > > (x ? a : b) = 1; > > > } > > > > This is a gcc extension. You can look in the info pages to see what gcc has > > as extensions, or you can use the -ansi flag on gcc to get it to issue > > warnings about its own extensions. > > Thanks. In fact I have to use -pedantic to get any warnings: > > [jsturm@toronto tmp]$ gcc -c -pedantic f.c > f.c: In function `f': > f.c:4: warning: ISO C forbids use of conditional expressions as lvalues > > > I believe that the ccc people plan on eventually adding all of gcc's > > extensions to ccc, which would be a great boon to AlphaLinux users. > > This example is apparently OK with several compilers besides gcc. I was just > curious who is right/wrong so I don't annoy the wrong people with a bug report > ;) > > (Sorry if this is OT. I know there are many ccc users here...) > > -- > Jeff Sturm > jeff.sturm@commerceone.com > > > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list