This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typedef vs. typename confusion
- To: Joe Buck <jbuck at synopsys dot com>
- Subject: Re: typedef vs. typename confusion
- From: Noel Yap <nyap at garban dot com>
- Date: Thu, 06 Aug 1998 16:27:42 -0400
- CC: jason at cygnus dot com, egcs at cygnus dot com
- Organization: Garban LLC
- References: <199808061940.MAA29430@atrus.synopsys.com>
Joe Buck wrote:
>
> > People should be able to specify a flag to compile older code. Did the
> > original compilers default to C behaviour (ie allowing use of
> > non-declared functions or assuming int when no type is specified)? I
> > don't think so, the compilers forced people to update their code, or
> > they supplied a switch that would allow older behaviour.
>
> Guess what g++ does? It allows use of non-declared functions, assuming
> int, and gives a warning. I think that it is time for this to go away,
> because it is now more trouble than it's worth, but g++ dates from the
> times where most people didn't have ANSI C, so they had no prototypes.
> Anyway, any change of this form should proceed in two stages:
>
> (phase 0: current practice)
> phase 1: previously accepted code now generates a warning.
> phase 2: previously warned-about code now generates an error.
I could go along with this, but, I still feel that it would slow down
progress to the new standard. For example, how much code do you think
has been written ignoring the warnings? Programmers are lazy by nature
-- if it works, it works; it may not be correct (ie works all the time),
but it works for now.
>
> It's a bad idea to go straight from phase 0 to phase 2.
That's what the "non-conformant" flag is for.
> You really don't get the problem. The problem is compiling *existing*
> code. You can't get in a time machine, go back to when the code was
> written and get people to use your new autoconf flags.
This is exactly the reason why problems should be fixed today, not wait
until more incorrect code is written.
Noel