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: integral location_t


Per Bothner wrote:-

> >Lineno == 0 is deliberately reserved.  It is possible of course to
> >assign special meanings to an arbitrary number of initial linenos.
> >However, it isn't possible to have lineno == 0 for a given file.  I'm
> >not sure what Nathan is referring to.
> 
> (fileline) 0 is specifically reserved.  Can we create a fileline
> for an arbitrary filename, with a line number of 0?  This could be
> used fo "unknown" or "whole file" or "line number not applicable".
> 
> If the current implementation can't support this, it is always
> possible to modify the implementation to do so, by always incrementing
> the line numbers before you enter them in the linemap tables.

I suggest making that -(n+1), where n is the index of the line map.  This
gives easy lookup with a very small amount of special code.

Neil.


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