This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: adding support for column numbers
- To: Per Bothner <bothner at cygnus dot com>
- Subject: Re: adding support for column numbers
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Thu, 14 Jan 1999 20:30:03 -0700
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199901141900.LAA09401@cygnus.com>you write:
> Mike S suggested it would be better to use a struct for linecol.
> I thought about it some, and realized we can still keep partial backwards
> compatibility if we make lineno a macro. So since a struct is a cleaner
> long-term solution, and the initial work seems no harder, and with errors
> more likely to be caught at compiler build time, I think that might be
> better.
structs & bitfields are definitely better.
> So here is another concept patch (i.e. it is incomplete and untested).
>
> One question: In a couple of functions, the code does:
> #ifndef ANSI_PROTOTYPES
> line = va_arg (ap, linecol);
> ...
> #endif
> However, I'm not sure if va_arg is guaranteed to work for structs.
> If not, we'll have to do some kludge, such as passing the line number
> only in those cases. (Since this is only for boot-strapping,
> that is good enough.)
You're supposed to be able to pass structs to varargs/stdarg routines, but
it's one of the areas where it's easy for gcc to run afoul of weird abi rules
and generate incorrect code. Hmmmm....
jeff