[fortran, patch] Fix handling of printf-style position specifiers of the form "%3$d" in error.c (PR29711)

Brooks Moses brooks.moses@codesourcery.com
Thu Dec 7 03:47:00 GMT 2006


Jerry DeLisle wrote:
> Tobias Burnus wrote:
>> Index: gcc/fortran/error.c
>> ===================================================================
>> --- gcc/fortran/error.c (Revision 119599)
>> +++ gcc/fortran/error.c (Arbeitskopie)
>> @@ -549,6 +549,7 @@
>>         {
>>           /* This is a position specifier.  See comment above.  */
>>           while (ISDIGIT(*format))
>> +           format++;
>>
>>           /* Skip over the dollar sign.  */
>>           format++;
>
> Is there a test case for this condition?   Or putting it another way, is there a 
> test case that did not catch the problem that should be fixed?

This particular bit of code, so far as I'm aware, only applies to 
versions of the compiler with translated error messages (since those are 
the only ones that use the "%3$d" form in error messages); it doesn't 
ever get used in the non-translated version.

As such, I can't think of any obvious way to test it within the 
testsuite.  (It might be a useful thing to put on the list of regression 
tests that someone should run manually every so often, though, along 
with the very-large-file tests that were mentioned in such a context a 
month ago.)

- Brooks



More information about the Fortran mailing list