------- Comment #4 from tromey at gcc dot gnu dot org 2007-02-14 19:50 ------- The patch I wrote does work. But now I think deferring error messages is not the best approach, since it imposes a cost on all error message output. Instead we could arrange for #error (and #warning) to build up a message in a buffer which is then printed after processing the line. That way the cost would only apply to the #error path.
Also I noticed a call to cpp_output_line in gcc/c-ppoutput.c. This needs to be checked to see if it suffers from the same bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27777