[PATCH, Fortran] Some work on PR 29835: Improve the error message for an invalid format

Daniel Kraft d@domob.eu
Tue Jul 22 14:53:00 GMT 2008


Hi,

the attached patch is an attempt to make the error message generated for 
invalid formats slightly better (PR 29835).  For the unexpected element 
case, the message changes from

Unexpected element in format string
   to
Unexpected element 'X' in format string,

i.e., states the offending character.  I also tried to improve the locus 
where an error is signalled in case of constant string expressions as 
formats.

It used to be gfc_current_locus and thus at the very end of the current 
statement, now it uses the locus of the expression; ideally it would 
mark the offending location even inside the string, but for this to work 
we would need some magic to happen to remember the locations for each 
character during gfc_simplify_expr; I'm not sure if this is feasible.

What do you think about these changes and the patch?  Bootstrapped and 
now regression testing, ok to commit if no failures?

Daniel, who won't have as much time tomorrow (probably), so the list 
won't be further flooded by patches soon, I think.

-- 
Done:     Arc-Bar-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
Underway: Cav-Dwa-Law-Fem
To go:    Cav-Hea-Kni-Mon-Pri-Ran-Rog-Tou
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080722/9cd2d05d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080722/9cd2d05d/attachment-0001.ksh>


More information about the Gcc-patches mailing list