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]

Re: adding support for column numbers



  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


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