[Patch, Fortran] PR68815 - replace '%s' quotes by %< ... %>

Tobias Burnus tobias.burnus@physik.fu-berlin.de
Wed Dec 9 15:53:00 GMT 2015


This patch replaces some of the '%s' quotes of diagnostic strings
by the nicer quotes.


First, it replaces some leftovers of '%s' -> %qs in directly used
error strings.


It then also converts some (well: resolve.c only) '%s' to %%<%s%%>,
which are using with sprintf(), but which are still passed as
fmt string to the diagnostic functions.

There is still code using '%s' - but those bits have the form
  sprintf (buffer, ".... '%s' ... ");
  gfc_error ("Bla ... : %s", ..., buffer);
which prevents the use of %< ... %>. (See last comment in the PR.)


In principle, %<%c%> and %<%d%> should be convertable to %qc and
%qd (as the code is more readable), but the current function
annotation prevent this, telling that the q flag is not valid for
%c and %d. As %< is fine, I didn't dig into it.


Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qs.diff
Type: text/x-diff
Size: 5242 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20151209/dca3021a/attachment.bin>


More information about the Fortran mailing list