Ping.

Bernd

On 03/14/2016 02:20 PM, Bernd Schmidt wrote:
On 03/11/2016 11:09 PM, David Malcolm wrote:
+      cpp_error (pfile, CPP_DL_ERROR,
+             "file \"%s\" left but not entered", new_file);
                                                          ^^^^^^^^
Although it looks like you're preserving the existing behavior from
when this was in linemap_add, shouldn't this be
   ORDINARY_MAP_FILE_NAME (from)
rather than new_file?  (i.e. shouldn't it report the name of the file
being *left*, rather than the one being entered?)

Hmm, almost but not quite. We don't necessarily know the name of the
file that's being left, if there's just a single #line directive as in
the testcase. I don't think we can reliably get a meaningful filename
other than the in the line directive. So maybe the error message needs
to be changed to something like "file %s unexpectedly reentered"?

Can we also have a testcase with a non-empty filename?  I'm interested
in seeing what the exact error messages looks like.

   # 1 "v.c"
   # 1 "t.h" 1
   int t;
   # 2 "v.c" 2

   int b;

t.h:2:12: error: file "b.c" left but not entered

So this shows the line number for the file we think we are in, which is
t.h. Would you accept this with the wording changed as suggested above?


Bernd

Reply via email to