Elliott C. Back: In Aere Aedificare

When GCC & C++ don’t play fair

Posted in C by Elliott Back on June 29th, 2005.

When GCC and C++ don’t play fair, you get error messages like this:

MyCoolProgram.cpp: In method`void MyCoolProgram::main_thing(const Parameter *)’:
MyCoolProgram.cpp:48: No match for`Logging<one , Two, Three>::make(const std::string&, int)’
MyCoolProgram.cpp:50: switch quantity not an integer
MyCoolProgram.cpp:51: case label `”thing.test.”‘ does not reduce to an integer constant
MyCoolProgram.cpp:53: confused by earlier errors, bailing out

I really find that error message too humane for a compiler. Error messages should be terse, informative, and technical. They should have razor-edge clarity, and not contain human babble that explains if they are “confused.” Wouldn’t you rather see something like, “Error recovery failed: no possible immediate 4-substitutions allow parsing?”

This entry was posted on Wednesday, June 29th, 2005 at 10:57 pm and is tagged with . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

2 Responses to 'When GCC & C++ don’t play fair'

  1. Bas Westerbaan said:

    on June 30th, 2005 at 1:30 am

    I guess the programmer that wrote that part of the compiler was confused about how a c++ file would have ended up in that certain state ;-)

  2. harlock59 said:

    on October 19th, 2005 at 10:30 am

    hello, ev’ryone !!
    i’d like to do a “switch case” with a string as case variable, but when i compile, i get a “switch quantity not an integer” ??
    isn’t it possible to use a switch case with a different type than an integer ??
    thanks for help !!
    bruno.

Your Thoughts Go Here:

Powered by WP Hashcash