3 ms·
Years ago I wrote a perfectly reasonable comment like /* WTF??!?!!?!???? */ and the old C compiler complained about "invalid trigraph". A syntax error in the mi
by DonHopkins 4y ago
Years ago I wrote a perfectly reasonable comment like /* WTF??!?!!?!???? */ and the old C compiler complained about "invalid trigraph". A syntax error in the middle of a comment!
Took me a while to figure out that "trigraph" was referring to some part of "??!?!!?!????" and not "WTF".
- hvdijk 4y agoThat's a bug, there is no such thing as an invalid trigraph. ?? followed by any character other than =, /, ', (, ), !, <, >, or - is not a valid trigraph, but that doesn't make it an invalid trigraph, that just makes it not a trigraph, it's perfectly valid to have ??? in a comment, or in a string literal.
- DonHopkins 4y agoAre you telling me that C compilers in the early 90's had bugs and confusing error messages??!!?!??? WTF?!??!?!?
- benj111 4y agoOh so that's why their called trigraphs, because there's 3 valid states? Valid Invalid ??? (Exercise for the reader to decide if this is a trigraph or not)