Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!wsmith From: wsmith@m.cs.uiuc.edu Newsgroups: comp.lang.c++ Subject: Re: Should C++ follow C's footsteps? Message-ID: <4800056@m.cs.uiuc.edu> Date: 24 Feb 89 16:57:00 GMT References: <4800051@m.cs.uiuc.edu> Lines: 27 Nf-ID: #R:m.cs.uiuc.edu:4800051:m.cs.uiuc.edu:4800056:000:981 Nf-From: m.cs.uiuc.edu!wsmith Feb 24 10:57:00 1989 I think one problem with direct compatibility between C++ and C is bad is the effect it has on error messages from CC. This construct was caused by a missing semicolon on line one, but the first error message refers to line 4. 1: int foo( int ) // ; 2: int bar; 3: int another_function(int c) 4: { 5: } The intent of this construct was to declare function foo for later use, but the semicolon was omitted. If the parser did not attempt to give a warning about old-fashioned parameter declarations, it would find an error on line 2 which is much closer to the original problem. Converting function headers to C++ standards is not a difficult task so that I don't think it is too expensive to disallow the old form. I don't think that semantically there is much problem with maintaining compatibility, but that for the compiler writer, excessive syntactic compatibility makes the compiler more difficult to write well. Bill Smith wsmith@cs.uiuc.edu uiucdcs!wsmith