5 ms·
The comment from SteveB in the linked-to thread was interesting: Most editors i have used highlight the next line in green as a comment, however i have
by chalst 15y ago
The comment from SteveB in the linked-to thread was interesting:
Most editors i have used highlight the next line in green as a comment,
however i have come across one that took me over a year to solve, that is
remarkably similar.
//why does this next line not compile??/
x = 0;
because the ??/ operator is a trigraph meaning \
That was never been highlighted correctly any editor I have used.
- derleth 15y agoYou know how the usual wisdom is that you can never remove anything from a public interface? I think compiler writers should test that by removing trigraphs. Silently at first, to avoid panic, then announce that a mistake has been fixed where some groups of three characters were lexed improperly into a completely unrelated single character. Never mention that the mistake was in the standard. I seriously doubt anyone would care if you did it that way. (Modern versions of gcc (4.5.2 at least) ignore trigraphs by default but issue warnings saying they ignored one and giving the command line option to honor them. But gcc has long honored the dumber parts of the standard more in the breach than the observance.)
- sterwill 15y agoI've seen C code on EBCDIC machines that uses trigraphs because some code pages lack #, {, }, etc. Someone probably still needs them.
- kragen 15y agoGCC has digraphs that are much more readable than ANSI trigraphs.
- esrauch 15y agoAre EBCDIC machines such a common development platform that trigraphs should be default on instead of default off with the option to enable? Though I suspect trigraphs being enabled is a very rare source of bugs to begin with, it seems likely that it is still more common than the scenario of active development on platforms that don't support the normal characters (eg the actual development is done on the platform rather than cross-compiled).
- s3b 15y agowait. So it should have been compiling before the comment was added. Why then was the comment added?
- kc5tja 15y agoTo prove a point.