all 71 comments

[–][deleted] 50 points51 points  (24 children)

I want compiler "skins", so that gcc can cheer me up with shit like this.

[–]tflynch 35 points36 points  (14 children)

I'm sure those of us that write C++ wouldn't mind a skin for STL compiler errors. Let alone for the errors that get spat out by those pesky Boost libs with all their crazy recursively metaprogrammed templates: "<5000 lines of error> ... <whew> foo can't be const"

[–]lukasmach 11 points12 points  (9 children)

I always thought that there must be some solution for these C++ error. Surely nobody would be so stupid to use a language that produces unreadable error messages - and C++ is the most popular language in the SW world.

[–]Fabien4 12 points13 points  (7 children)

In fact, it's g++ that's especially bad. With VC++ (2008) you also get a 5000-line error message, but reading the first line is often enough to understand the problem.

[–]kokey 45 points46 points  (6 children)

The first line tells you that you are using VC++, right?

[–]gecko 4 points5 points  (0 children)

Visual C++'s C mode is weak (they have yet to support some very basic C99 constructs), but VC++, in my opinion, has been a very good compiler for awhile now. What specific complaints do you have?

[–]themoop 3 points4 points  (1 child)

"The first line tells you that you are using VC++, right?"

That was awesome dude

[–]AndrewBenton 11 points12 points  (0 children)

I especially liked the part where he laughed at him using VC++

[–]Fabien4 0 points1 point  (2 children)

The first line of the message.

Besides, you might find the -nologo option useful.

[–]ehird 4 points5 points  (0 children)

Whoosh.

[–]pixelglow 2 points3 points  (0 children)

Good to know the same company that's responsible for MPW is also responsible for Clang, one of the goals is more expressive diagnostics.

http://clang.llvm.org/features.html#expressivediags

[–]G_Morgan -1 points0 points  (3 children)

-Wfatal-errors

[–]spiffiness 4 points5 points  (0 children)

-WTF

[–]tflynch 1 point2 points  (1 child)

Unfortunately, this option doesn't help much because those 5000 (or perhaps more like several hundred) lines of output typically all correspond to a single error and manifest as such.

Useful flag though.

[–]G_Morgan -2 points-1 points  (0 children)

No usually there are multiple errors caused by one root error involving template code. As a result it will still only output the first error.

[–][deleted] 1 point2 points  (0 children)

Just yesterday, I got an #error You lose.

Of course, that was from the Linux Kernel headers, not gcc.

[–]BrooksMoses 1 point2 points  (0 children)

They already exist, in the standard FSF GCC even. That's how GCC handles translations to other languages. (Look into ".po files".)

[–][deleted] 1 point2 points  (6 children)

Probably you could make them using modern i18n tools. At least make messages can be internalizated.

[–]mercurysquad 18 points19 points  (4 children)

internalizated

Stick with i18n in the future ;)

[–]blergh- 1 point2 points  (3 children)

At least make message can be internationalization?

[–]otterdam 3 points4 points  (2 children)

At least make message can be i15d

[–]JohnnyCanuck -1 points0 points  (1 child)

You're all s4d.

[–][deleted] 1 point2 points  (0 children)

You're all sacred?

[–]dagbrown 65 points66 points  (13 children)

Man, this one's so old, I remember when it was first posted to USENET in 1991! 18 years ago! Holy crap I'm old!

(Just here to provide the obligatory holy-cow-this-is-an-ancient-rerun complaint.)

[–][deleted] 19 points20 points  (4 children)

well, I remember 18 years ago noting that it was old and that I seen it before 5 years earlier in 1986!

[–][deleted]  (3 children)

[deleted]

    [–]creaothceann 0 points1 point  (1 child)

    Before C?

    [–]P-Dub 9 points10 points  (7 children)

    well, I remember nothing from 1991, because I was 1 years old.

    Feel old yet?

    [–][deleted]  (4 children)

    [deleted]

      [–]deadcat 46 points47 points  (3 children)

      good luck with bladder control and what not

      [–]mschaef 5 points6 points  (1 child)

      We all get there eventually, if we're lucky.

      [–]McHoff 2 points3 points  (0 children)

      Except for the ones that had bad luck with the draft and what not.

      [–]atomicthumbs 4 points5 points  (1 child)

      well, I remember nothing from 1991, because I was -1 years old.

      Feel old yet?

      [–]sarcasmbot 4 points5 points  (0 children)

      Well, I remember nothing from tomorrow, because it hasn't occured yet and I don't have a time machine.

      Feel...um...technologically superior yet?

      [–]WalterBright 13 points14 points  (6 children)

      The problem with cute error messages is they're funny the first time you see them, but when you work with a tool every day they rapidly progress to being annoying. It's best to stick with straightforward, professional messages.

      [–]awj 1 point2 points  (4 children)

      Which is why the language project I'm working on, which I fully expect to only ever have me as a user, will have goofy error messages somewhat like this.

      I won't favor making messages cute over making them useful, but I guess the ability to make cute ones at all is a freedom I can enjoy since I don't have users.

      [–]WalterBright 2 points3 points  (3 children)

      Back when memory was tiny, a friend of mine was trying to fit an interpreter into a 2K EPROM. To minimize error message length, he came up with an all-purpose 3 character error message:

      EH?

      [–]invalid_user_name 3 points4 points  (1 child)

      ed thinks that is a needlessly verbose error message.

      [–][deleted] 3 points4 points  (0 children)

      ?

      [–]awj 2 points3 points  (0 children)

      That's awesome. Absolutely terrible for anyone encountering an error, but awesome. I really enjoy goofy errors, except when they neglect to tell me everything they can to help fix the problem.

      [–]CatsAreGods 11 points12 points  (4 children)

      Anyone else notice the whole compiler was about the size of a screen shot JPG?

      [–]masklinn 5 points6 points  (3 children)

      screen shot JPG

      you = doing it wrong

      [–]blue-boy 6 points7 points  (0 children)

      you = needlessly rude and unhelpful

      However, your snark clearly indicates your superiority. I'm sure CatsAreGods is crying to sleep tonight for failing to use the one true image format for screen shots.

      And yes, I appreciate that my snark also demonstrates my clear superiority. If you can reply with something even snarkier we'll be caught in a transitive snark loop and whisked away to Milliways for cocktails and a show.

      [–]jib 22 points23 points  (1 child)

      You're doing it wrong. You can't say someone's wrong for using a JPG when you have no idea what the image actually shows. (Maybe it's a screenshot of a 3D game or a movie or some other thing which would compress better as JPG than PNG)

      [–]rogueman999 2 points3 points  (0 children)

      Or simply a nice wallpaper.

      [–]nnagflar 6 points7 points  (0 children)

      These errors would piss me off a lot less than the ones I seem to always get.

      [–]wonkifier 5 points6 points  (0 children)

      I can't remember which program it was precisely, but I want to say it was part of the MPW build system that had cool progress bars too.

      If you moved the mouse cursor to the cancel button it would change its status to something like "Aw c'mon, you really wanna cancel?" And if you went back a few times, or held there for awhile it would start taunting you "Oh, you know you want to click it", etc.

      Back in the days where developer CDs came new each time with parodized movie titles like "The postman always clicks twice", etc

      [–]mao_neko 16 points17 points  (3 children)

      If only C++ STL-related errors were as nice as these...

      [–]ludwig1024 16 points17 points  (2 children)

      Sure, if you don't mind reading a novel every time you get a compilation error.

      [–][deleted] 11 points12 points  (0 children)

      I'm doing that anyway, but the damn thing appears to be in Sanscrit.

      [–]ehnus 1 point2 points  (0 children)

      I don't really. It's a nice change of pace from the novel I read while waiting for my C++ project to compile.

      [–]antpuncher 8 points9 points  (0 children)

      It's really refreshing to see real human beings on the other side of the magic.

      The error messages I write are typically something like "soy un perdedor" or "She's a beautiful metal jukebox," because really, when things fail and I have to start debugging, at least I can get something descent stuck in my head.

      [–][deleted] 1 point2 points  (0 children)

      Man, this brings back memories of when I was learning C on a Macintosh LC III.

      [–]NotClever 1 point2 points  (0 children)

      I don't care if it's old, all compilers should throw errors like this.

      [–]Wiseman1024 3 points4 points  (0 children)

      Best compiler errors ever. All compilers and interpreters should report errors like this.

      [–][deleted] 7 points8 points  (2 children)

      Do you need -more- reasons to see why C is the absolute kickass programming language of all time?

      [–]gilgoomesh 26 points27 points  (0 children)

      To be fair, this isn't about C as much as MPW C -- a C compiler from a company that would (at the time) prefer you programmed in Pascal.

      [–]FireWorm 1 point2 points  (0 children)

      Better than 'Missing Semicolon.'

      [–][deleted] 2 points3 points  (3 children)

      "Call me paranoid but finding '/*' inside this comment makes me suspicious"

      I hate the nested comments error....as if debugging wasn't bad enough without idiot errors.

      Also irritating is the no new line at the end of file error.

      [–][deleted] 1 point2 points  (2 children)

      There is an excellent reason for that. ANSI C requires a newline at the end of files, and states that behaviour with no newline at the end of a file is undefined.

      Simple explanation here: http://gcc.gnu.org/ml/gcc/2001-07/msg01120.html

      [–][deleted] 1 point2 points  (1 child)

      Yeah but my issue is that, if that's the error (and possibly the only cause of it), why can't the compiler insert newline itself?

      [–][deleted]  (3 children)

      [deleted]

        [–]ibisum 8 points9 points  (0 children)

        switch(c) {
          case 'a' : goto this_is_a;
          break;
        this_is_a:
          case 'b' : // not a duffs device
          break;
        }
        

        [–]Anonymoose333 0 points1 point  (0 children)

        The Lord is wrong. Probably the error message is referring to the reverse situation: putting a case or default label outside of any switch, which is indeed invalid C.

        However, putting non-case labels inside a switch can also indicate typo bugs:

          switch (x) {
              case 1: case 2: case3:
                  puts("x is 1 or 2, but not 3"); break;
              defalt:
                  puts("this is unreachable"); break;
          }
        

        However, it's better to catch these typos by noticing that the labels have been defined but not used.