🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5685

Re: is f().c legal? How about (&(f()))->c ?

#5685
From: Guy Harris
Date: Sat, 28 Jan 1989 23:45
21 lines
1429 bytes
>I am trying to figure out why C compilers like the latter expression
>and cant handle the first expression.

Because they're buggy.

In particular, pre-S5 versions of PCC (upon which the Sun compiler is
based) had some bogus code for determining whether something was a legal
structure reference.  The S5 version had a differently bogus version
that attempted to fix the first version.  The SunOS 4.0 compiler has one
that avoids both of those forms of bogosity; however, it still doesn't
catch some other illegal constructs.  I think the 4.3-tahoe compiler has
something to catch those as well.

HP-UX may, at least on the 68K-based HPs, also have a PCC-derived
compiler, and thus have inherited one or more of the aforementioned
bugs.

This is why "my compiler does/doesn't accept this construct" is not
always a good test of whether the construct is legal or not.  That's why
you need a standard - and conformance tests, so that bugs such as the
aforementioned get caught and, hopefully, fixed.
Technical Details
Message-ID: <912@auspex.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!3comvax!bridge2!auspex!guy
References: <2648@vedge.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!3comvax!bridge2!auspex!guy
From: guy@auspex.UUCP (Guy Harris)
Newsgroups: comp.std.c
Subject: Re: is f().c legal?  How about (&(f()))->c ?
Keywords: ansi
Message-ID: <912@auspex.UUCP>
Date: 28 Jan 89 23:45:07 GMT
References: <2648@vedge.UUCP>
Reply-To: guy@auspex.UUCP (Guy Harris)
Organization: Auspex Systems, Santa Clara
Lines: 21