From: "Chris Eleveld (Sector 7 Group)" <Chris_Eleveld@sector7.com>
To: axp-list@redhat.com
Subject: Re: ccc error [OT]
Date: Tue, 9 Jan 2001 12:05:11 -0600 [thread overview]
Message-ID: <20010109120511.N19919@taarna.sector7.com> (raw)
In-Reply-To: <3A5B4184.37986642@appnet.com>; from Jeff Sturm on Tue, Jan 09, 2001 at 11:51:16AM -0500
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
next prev parent reply other threads:[~2001-01-09 18:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.10.10101090204570.19797-100000@cc42593-a.taylor1.mi.home.com>
2001-01-09 7:26 ` ccc error jeff.sturm
2001-01-09 9:49 ` Georg Wittig
2001-01-09 9:58 ` Uncle George
2001-01-09 16:35 ` Michal Jaegermann
2001-01-09 13:51 ` Greg Lindahl
2001-01-09 13:59 ` Thomas Leitner
2001-01-09 16:51 ` Jeff Sturm
2001-01-09 18:05 ` Chris Eleveld (Sector 7 Group) [this message]
2001-01-09 18:20 ` ccc error [OT] Michal Jaegermann
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox