From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: g++@cygnus.com, egcs@cygnus.com Subject: implicit declaration in C++ considered harmful Date: Wed, 08 Apr 1998 02:13:00 -0000 Message-id: <199804080026.RAA28665@atrus.synopsys.com> X-SW-Source: 1998-04/msg00303.html I'd like to nuke the implicit declaration of functions in C++. This thoroughly broken feature cannot be turned off. Yes, you get a warning, and you can make warnings errors, but the problem is that if a user forgets to declare a function, or mistypes it, cascades of dozens of errors can result, because g++ declares it as int foo(...), then objects to all class objects passed to this function, then objects to use of the result in a context where ints aren't allowed, etc. Or else the file compiles normally, and errors aren't noticed until link time. Now, in the early days of C++ when we were all basically C programmers, this hangover from K&R C may have been desirable. But the time is overdue to kill this sucker; these days, chances are good that most functions I write are going to get a class object passed to them, so the default declaration just can't be right. First, it should be an error, not a warning. Second, the compiler should insert an error node, not a function returning integer, so that we don't get a cascade of errors. Is there anyone who really wants the existing behavior? Joe