This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: typedef vs. typename confusion



> 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.

It's a bad idea to go straight from phase 0 to phase 2.

Now, if you'd like to *warn* about template problems, that's doable.

> I would guess ('cos I haven't really used it) that autoconf would be
> able to tell what compiler switches should be used.  Also, I haven't
> seen too much freeware written in C++, much less ones using templates.

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.

> > You, Noel, may use an alias so that when you type gcc you get
> > gcc -pedantic.  You may report as bugs any case where -pedantic does
> > not enforce a rule.  But it's not reasonable to demand, after more
> > than a decade of success, that gcc suddenly change its basic philosophy.
> 
> First of all, I am not demanding, just merely suggesting.  Second,
> philosophies must be questioned, especially basic ones.  If they are
> lacking, they should be changed.

Nothing is lacking, since the -pedantic flag exists.

> After all, gcc has been around for
> *only* ten years, I presume that it'll be around for much longer than
> that. 

It seems that 10.5 years ago gcc 1.17 was released (there is no
ChangeLog information earlier than that).

> The earlier "basic" philosophies are changed, the easier they are
> to change.

gcc has around a million users.  You are one user.  Your personal needs
can be satisfied with "-pedantic" (at least, they could be if -pedantic
were fixed).





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]