This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Identifying source file locations.
- To: Kenneth Almquist <kalmquist2 at hotmail dot com>
- Subject: Re: Identifying source file locations.
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Sun, 10 Jun 2001 19:07:58 +0100
- Cc: gcc at gcc dot gnu dot org
Kenneth Almquist wrote:-
> In verbose mode, we show the preprocessor expansion of ARRAY_SIZE
> and the point to the error location within the expansion.
>
> Compiling: tte4.c
>
> 9. array = malloc(ARRAY_SIZE);
> |
> (32 ** sizeof(int))
> |
> >>> invalid type argument of `unary *'
>
> To print this error message, we use the column field as an index
> into a data object representing the second "*" token. This
> object points to a second object containing a list of all the
> tokens resulting from expanding ARRAY_SIZE, as well as the
> number of the column where ARRAY_SIZE appears.
Hmm. This would be very nice, but I'm not sure it's practical. We
don't necessarily want to be keeping around the expansion of a macro;
they can be enormous. Do you go up to the nearest enclosing macro
expansion, or the outermost? Other things that need thinking about
are what happens if the ARRAY_SIZE token crosses more than one line,
and what do we show if its expansion is very long.
Keeping all the information this would seem to require could be quite
a memory hog, too.
Neil.