https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632

--- Comment #11 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Its not really a glitch.  In this case reversion has occurred so i can only
> approximate where in the string the error occured.  I can improve on it with:
>
>   offset = fmt->reversion_ok ? fmt->format_string_len + 2:
>                              dtp->format_len - fmt->format_string_len;
>
> I don't think I can do better for now.  Of course we want diagnostics to be
> helpful, but they can not be perfect.  I would suggest we commit the patch 
> for now.

What about the following?

   if (f != NULL)
-    fmt->format_string = f->source;
+    fmt->format_string_len = strrchr (f->source, ')') - &f->source[0] + 1;

It is clumsy, but it does the trick. If accepted, I can write a test case for
it.

Reply via email to