add "%J" for diagnostics (Redux. Positional format specifier for diagnostic)

Richard Henderson rth@redhat.com
Mon Sep 22 22:14:00 GMT 2003


On Tue, Sep 23, 2003 at 06:42:23AM +0900, Chiaki wrote:
> The way I read text_specifies_location() and routines in
> pretty-print.c suggests that the similar handling now performed for
> "%H" at the beginning of a format string needs to be done for '%J'.
> 
> Or am I missing something here?

You are missing something.

  /* Extract the location information if any.  */
  if (p[0] == '%' && p[1] == 'H')
    {
      *locus = *va_arg (*text->args_ptr, location_t *);
      text->format_spec = p + 2;
      return true;
    }
  else if (p[0] == '%' && p[1] == 'J')
    {
      tree t = va_arg (*text->args_ptr, tree);
      *locus = DECL_SOURCE_LOCATION (t);
      text->format_spec = p + 2;
      return true;
    }

The code IS present.

> I assume that like "%H", "%J" is meant to come only at the beginning
> of a format string.  Am I correct in this assumpition?

Yes.


r~



More information about the Gcc-patches mailing list