🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2944

Re: Standard conformance and GCC 2.3.3

#2944
From: Christopher R Volpe
Date: Thu, 31 Dec 1992 15:00
56 lines
3309 bytes
In article <1992Dec30.203555.3615@netcom.com>, rfg@netcom.com (Ronald F. Guilmette) writes:
|> In article <1992Dec30.173634.15487@crd.ge.com> volpe@ausable.crd.ge.com writes:
|> +In article <C02I8I.58I@jrd.dec.com>, diamond@jit533.jit.dec.com (Norman Diamond) writes:
|> +|> >-----------------------------------------------------------------------------
|> +|> >#9)  GCC fails to issue errors in cases where a static function is referenced
|> +|> >     but never defined, even when the -pedantic-errors option is used.
|> +|> >static void s (); int main () { s (); return 1; }
|> +|> 
|> +|> Again I see no violation of a constraint.  Furthermore, if you returned
|> +
|> +Me neither, but...
|> 
|> See ANSI section 3.7, constraints.

Opps. You're right. Thanks.

|> 
|> +|> >-----------------------------------------------------------------------------
|> +|> >#20)  GCC incorrectly issues errors for the following standard-conformant
|> +|> >      ANSI C code when the -pedantic-errors option is used.
|> +|> >static enum E1 { red, green, blue};
|> +|> >static struct S1 { int member; };
|> +|> >static union U2 { int member; };
|> +|> >void foobar () {
|> +|> >	auto enum E2 { red, green, blue };
|> +|> >	auto struct S2 { int member; };
|> +|> >	auto union U2 { int member; };
|> +|> >}
|> +|> 
|> +|> Spurious diagnostics are allowed, though now they return to the status of
|> +|> unfriendly and misleading.  What happened when you tried executing it?
|> +
|> +These diagnostics are prefectly friendly and very helpful. Since the
|> +declarations allocate no storage (there's no object being defined), a 
|> +storage class specifier is useless and superfluous.
|> 
|> I disagree violently with the assertion that the issuance of errors for
|> perfecly "standard conformant" code is "perfectly friendly and very helpful".
|> Anyone who says such a thing obviously does not port code for a living!

I disagree violently with the assertion that any errors one might make
would necessarily result in non-standard-conformant code. Just because 
it's conformant doesn't mean it's intended. Anyone who says such a thing
obviously never writes original code for a living, or otherwise is a 
complete programming God who has never made a mistake and never found
lint to be the least bit useful. 

I would *never* write the above piece of code intentionally, no matter
how conformant it is, and I would appreciate some kind of warning that
I had obviously omitted some variable names in those declarations.

-- 
==================
Chris Volpe
G.E. Corporate R&D
volpecr@crd.ge.com
Technical Details
Message-ID: <1992Dec31.150047.22321@crd.ge.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!usenet.ins.cwru.edu!agate!ames!saimiri.primate.wisc.edu!crdgw1!rdsunx.crd.ge.com!bart!volpe
References: <1992Dec30.011211.11409@netcom.com> <C02I8I.58I@jrd.dec.com> <1992Dec30.173634.15487@crd.ge.com> <1992Dec30.203555.3615@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!usenet.ins.cwru.edu!agate!ames!saimiri.primate.wisc.edu!crdgw1!rdsunx.crd.ge.com!bart!volpe
From: volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe)
Newsgroups: comp.std.c
Subject: Re: Standard conformance and GCC 2.3.3
Message-ID: <1992Dec31.150047.22321@crd.ge.com>
Date: 31 Dec 92 15:00:47 GMT
References: <1992Dec30.011211.11409@netcom.com> <C02I8I.58I@jrd.dec.com> <1992Dec30.173634.15487@crd.ge.com> <1992Dec30.203555.3615@netcom.com>
Sender: volpe@bart (Christopher R Volpe)
Reply-To: volpe@ausable.crd.ge.com
Organization: GE Corporate Research & Development
Lines: 56
Nntp-Posting-Host: bart.crd.ge.com