This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: to_line blowing up


Mike Stump wrote:
Ok, so call me confused, how can:
  unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line);
possibly be right?

This looks wrong to me also. It isn't clear what it is supposed to be, because it looks like to_line is used for two different purposes. In one case, it is supposed to be the last line of the file (LC_LEAVE), and in the other case it looks like it should be the first line.


Related to this, should from_line ever be > to_line in the map?

I believe so. This is used for #line. So if at line 100 in the input file we have a #line that maps to line 1 in a different file, then from_line is 100 and to_line is 1.


If one compiles:
int i;
as a C++ file, and watches what the above code does, one should be able to see it go bad.

This I don't see. With a trivial input file, from_line and to_line are both 1, and nothing bad happens.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]