🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #2632

Re: Should C++ follow C's footsteps?

#2632
From: wsmith@m.cs.uiuc
Date: Fri, 24 Feb 1989 16:57
28 lines
983 bytes

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

Message-ID: <4800056@m.cs.uiuc.edu>
Path: rocksolid-us.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!wsmith
References: <4800051@m.cs.uiuc.edu>