------- Comment #4 from igodard at pacbell dot net  2007-08-29 02:27 -------
OK, I see. I doubt I'm the only one who is confused by the report of a mis-used
obscure gcc-only "feature" instead of an all-too-common parenthesis error :-) 
However, if you are emitting diagnostics on the fly then you have little choice
but accept the last valid parse, which exposes you to trouble when the user has
excess closers.

In the compilers I've done we didn't do the diagnostics on the fly, but the
diagnostic emitter backed up the parse to previous levels of the bracket tree
and reparsed omitting either the opener or the last preceding closer at each
level. We took the parse that got farthest, reporting a "probably" excess or
missing bracket at the point where it did (or did not) appear. This avoided
nearly all of the cascaded errors that gcc produces. Of course, that was in the
days when a recompile was half an hour not 20 seconds, and getting the compiler
as far as you could was a big help to the programmer :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33176

Reply via email to