5 ms·
Apple’s MPW C compiler had some funny error messages, sometimes also useful. Examples: - This label is the target of a goto from outside of the block containin
by Someone 5y ago
Apple’s MPW C compiler had some funny error messages, sometimes also useful. Examples:
- This label is the target of a goto from outside of the block containing this label AND this block has an automatic variable with an initializer AND your window wasn't wide enough to read this whole error message
- String literal too long (I let you have 512 characters, that's 3 more than ANSI said I should)
- Too many errors on one line (make fewer)
Whenever I read these again (e.g. on https://www.cs.cmu.edu/~jasonh/personal/humor/compile.html https://www.cs.cmu.edu/~jasonh/personal/humor/compile.html), I wonder what made ANSI pick 509 as the limit for the length of string literals.
- jstimpfle 5y ago> I wonder what made ANSI pick 509 as the limit for the length of string literals. Just a guess: In a 512 byte block, a 509 bytes long string literal would leave room for a NUL terminator and a 16-bit length field (prefix).
- themulticaster 5y ago> - Too many errors on one line (make fewer) Thank god it wasn't a C++ compiler... I have a love/hate relationship with C++, but some of those error messages are just awful. When it comes to template errors in C++, I almost never try to understand any of the gibberish and just look for the file and line where the error was originally reported. Which is a task in itself, since most of the time the file you actually care about is neither at the bottom nor at the top of the pile of files. On the other hand, error messages other than template-related errors have improved in C++ lately.
- getpost 5y ago“Unexpected friend” was one of my favorites in C++. It seemed fortuitous; it’s good to have friends, right? (Usually the actual error was a missing semicolon.)
- smoldesu 5y agoSometimes I gaze into the stars and wonder how many programming careers were ruined by nebulous "stack overflow", "null pointer exception" and "segmentation fault: core dumped" messages.
- hulitu 5y agoBus error. (i miss those pizza boxes)
- hulitu 5y agoAnd the all time favourite: "This programm has violated system integrity and must be terminated"
- laurent92 5y agoTalking about StackOverflow, shouldn’t all messages have a permalink to their StackOverflow unique identifier where people will discuss them ;)
- dkarl 5y agoA really evil programming language would give you an error code and a link to create a question on Stack Overflow asking what the hell it means.
- easton 5y agoVisual Studio already does almost this, if you hover over a Intellisense or Build error it will give you a link to search for it on Bing. Which is extremely helpful when the error is "Linker error". https://docs.microsoft.com/en-us/visualstudio/ide/find-and-fix-code-errors?view=vs-2022#review-errors-in-detail https://docs.microsoft.com/en-us/visualstudio/ide/find-and-f...
- chrsig 5y agoThe best advice I've gotten on template error messages is that it's either at the top of the output or the bottom...then you've just gotta hope that your terminal has enough of a buffer to see the top[0] :) [0] yes i know terminals support quasi-infinite scrollback by writing to a file, or i could redirect. but that makes for much less amusing anecdote.
- marcosdumay 5y agoWell, you have to define a buffer size for the lexer, for both avoiding dynamic allocations and avoid bowing your memory. A 512 bytes buffer can hold 509 ASCII characters, two quotes and a zero terminator. I don't know why they did it, but the size makes a lot of sense.
- Someone 5y agoBut why would the lexer include the delimiting quotes in the token for a string literal?
- marcosdumay 5y agoYou probably wouldn't. But a standard should allow the most possible kinds of usage, and there are some situation where it makes sense (like on transpilers).