Mathias Hasselmann

29 years and still immature...

g++ just gave me this error message right now:

./JavaScriptCore/kjs/ArgList.h:133: error: extra qualification 'KJS::ArgList::' on member 'operator new'

Would be nice if this language (or its compilers) would have matured that much, that you don't always need exactly the same C++ compiler as the guy writing the code you try to compile. It was just 29 years ago, that C++ was invented...


Murray Cumming commented on July 23, 2008 at 9:55 a.m.

That's just a warning. That build system has decided to make all warnings be errors, which is stupid for a tarball build.

Kai Schroeder commented on July 23, 2008 at 11:12 a.m.

No, its not a warning. Recent gcc versions treat that as an error.

oliver commented on July 23, 2008 at 11:14 a.m.

Switching from gcc3 to gcc 4.1.1 gave me lots of these errors... Annoying, yes; but every error pointed to some copy/paste mistake that had gone undetected before.
So isn't the real problem rather that the previous compiler was too lax on this code (probably not adhering to that 29-year-old standard)?

Denis Leroy commented on July 23, 2008 at 11:17 a.m.

Nothing to do with maturity really.

The C++ language does evolve over time, while C is pretty much set in stone. I'm not saying it's good or bad, just that the C++ spec changes occasionally. And so maintaining and compiling C++ code does require a little bit more effort...

Sam Morris commented on July 23, 2008 at 12:20 p.m.

It's not really a case of the language spec changing. Your code was incorrect since it was written, and now a new GCC is actually refusing to deal with it.

Igor commented on July 24, 2008 at 5:41 p.m.

Microsoft Visual C++ compiler allow you to do that... but that's not standard C++

But thinking about it for me GCC is doing the right thing.

Extraqualification is an error and makes you code looks bad and ugly.

Matteo commented on July 25, 2008 at 12:03 a.m.

I must second Igor here; that code doesn't adhere to the standard. It should be changed, also for compatibility with other C++ compilers (e.g. Comeau and Intel one).

It is surprising that GCC waited 29 years before throwing an error instead of a warning, though.