🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2936

Re: Standard conformance and GCC 2.3.3

#2936
From: Ronald F. Guilmette
Date: Wed, 30 Dec 1992 20:35
68 lines
3787 bytes
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:
+|> In article <1992Dec30.011211.11409@netcom.com> rfg@netcom.com (Ronald F. Guilmette) writes:
+|> >-----------------------------------------------------------------------------
+|> >#7)  When compiling an empty source file while the -pedantic-errors option
+|> >     is in effect, GCC will generate an error message for a line number which
+|> >     does not actually exist in the source file.
+|> 
+|> I believe that diagnostics are allowed to contain spurious line numbers unless
+
+I believe the diagnostics are allowed to say anything they want...

Correct.  This is strictly a "quality of implementation" issue.

+|> >-----------------------------------------------------------------------------
+|> >#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.

+|> >-----------------------------------------------------------------------------
+|> >#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!


// Ron ("Loose Cannon") Guilmette    uucp: ...uunet!lupine!segfault!rfg
//
//      "On the one hand I knew that programs could have a compelling
//       and deep logical beauty, on the other hand I was forced to
//       admit that most programs are presented in a way fit for
//       mechanical execution, but even if of any beauty at all,
//       totally unfit for human appreciation."
//                                              -- Edsger W. Dijkstra

-- 

// Ron ("Loose Cannon") Guilmette    uucp: ...uunet!lupine!segfault!rfg
//
//      "On the one hand I knew that programs could have a compelling
//       and deep logical beauty, on the other hand I was forced to
//       admit that most programs are presented in a way fit for
//       mechanical execution, but even if of any beauty at all,
//       totally unfit for human appreciation."
//                                              -- Edsger W. Dijkstra
Technical Details
Message-ID: <1992Dec30.203555.3615@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!umn.edu!csus.edu!netcom.com!rfg
References: <1992Dec30.011211.11409@netcom.com> <C02I8I.58I@jrd.dec.com> <1992Dec30.173634.15487@crd.ge.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!umn.edu!csus.edu!netcom.com!rfg
From: rfg@netcom.com (Ronald F. Guilmette)
Newsgroups: comp.std.c
Subject: Re: Standard conformance and GCC 2.3.3
Message-ID: <1992Dec30.203555.3615@netcom.com>
Date: 30 Dec 92 20:35:55 GMT
References: <1992Dec30.011211.11409@netcom.com> <C02I8I.58I@jrd.dec.com> <1992Dec30.173634.15487@crd.ge.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Lines: 68