home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / c / 3304 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  3.2 KB

  1. Path: sparky!uunet!paladin.american.edu!gatech!usenet.ins.cwru.edu!agate!ames!saimiri.primate.wisc.edu!crdgw1!rdsunx.crd.ge.com!bart!volpe
  2. From: volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Standard conformance and GCC 2.3.3
  5. Message-ID: <1992Dec31.150047.22321@crd.ge.com>
  6. Date: 31 Dec 92 15:00:47 GMT
  7. References: <1992Dec30.011211.11409@netcom.com> <C02I8I.58I@jrd.dec.com> <1992Dec30.173634.15487@crd.ge.com> <1992Dec30.203555.3615@netcom.com>
  8. Sender: volpe@bart (Christopher R Volpe)
  9. Reply-To: volpe@ausable.crd.ge.com
  10. Organization: GE Corporate Research & Development
  11. Lines: 56
  12. Nntp-Posting-Host: bart.crd.ge.com
  13.  
  14. In article <1992Dec30.203555.3615@netcom.com>, rfg@netcom.com (Ronald F. Guilmette) writes:
  15. |> In article <1992Dec30.173634.15487@crd.ge.com> volpe@ausable.crd.ge.com writes:
  16. |> +In article <C02I8I.58I@jrd.dec.com>, diamond@jit533.jit.dec.com (Norman Diamond) writes:
  17. |> +|> >-----------------------------------------------------------------------------
  18. |> +|> >#9)  GCC fails to issue errors in cases where a static function is referenced
  19. |> +|> >     but never defined, even when the -pedantic-errors option is used.
  20. |> +|> >static void s (); int main () { s (); return 1; }
  21. |> +|> 
  22. |> +|> Again I see no violation of a constraint.  Furthermore, if you returned
  23. |> +
  24. |> +Me neither, but...
  25. |> 
  26. |> See ANSI section 3.7, constraints.
  27.  
  28. Opps. You're right. Thanks.
  29.  
  30. |> 
  31. |> +|> >-----------------------------------------------------------------------------
  32. |> +|> >#20)  GCC incorrectly issues errors for the following standard-conformant
  33. |> +|> >      ANSI C code when the -pedantic-errors option is used.
  34. |> +|> >static enum E1 { red, green, blue};
  35. |> +|> >static struct S1 { int member; };
  36. |> +|> >static union U2 { int member; };
  37. |> +|> >void foobar () {
  38. |> +|> >    auto enum E2 { red, green, blue };
  39. |> +|> >    auto struct S2 { int member; };
  40. |> +|> >    auto union U2 { int member; };
  41. |> +|> >}
  42. |> +|> 
  43. |> +|> Spurious diagnostics are allowed, though now they return to the status of
  44. |> +|> unfriendly and misleading.  What happened when you tried executing it?
  45. |> +
  46. |> +These diagnostics are prefectly friendly and very helpful. Since the
  47. |> +declarations allocate no storage (there's no object being defined), a 
  48. |> +storage class specifier is useless and superfluous.
  49. |> 
  50. |> I disagree violently with the assertion that the issuance of errors for
  51. |> perfecly "standard conformant" code is "perfectly friendly and very helpful".
  52. |> Anyone who says such a thing obviously does not port code for a living!
  53.  
  54. I disagree violently with the assertion that any errors one might make
  55. would necessarily result in non-standard-conformant code. Just because 
  56. it's conformant doesn't mean it's intended. Anyone who says such a thing
  57. obviously never writes original code for a living, or otherwise is a 
  58. complete programming God who has never made a mistake and never found
  59. lint to be the least bit useful. 
  60.  
  61. I would *never* write the above piece of code intentionally, no matter
  62. how conformant it is, and I would appreciate some kind of warning that
  63. I had obviously omitted some variable names in those declarations.
  64.  
  65. -- 
  66. ==================
  67. Chris Volpe
  68. G.E. Corporate R&D
  69. volpecr@crd.ge.com
  70.