4 ms·
You 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. Si
by derleth 15y ago
You 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).