[fortran,patch] Fix matching of format labels (PR 34108)

Jerry DeLisle jvdelisle@verizon.net
Sat Nov 17 00:53:00 GMT 2007


FX Coudert wrote:
> Attached patch fixes PR 34108, an ICE on invalid code such as "write 
> (*,0)". This is due to a checking the e->value.character.string of the 
> constant integer 0! This is fixed by the one line in 
> check_format_string, but I noted that the fact that we even came to that 
> point would be fixed is matching aborted earlier, with a more specific 
> error message (instead of "Missing left parenthesis"!). But we can do 
> better: if gfc_match_st_label() returns MATCH_ERROR, it means that it 
> found an integer, that is not a suitable label, and we should emit that 
> error message (either "label is zero" or "label has too many digits") 
> and bail out, because we can't recover from that anyway (there's no way 
> a litteral integer constant as format is valid if it's not a label).
> 
> Bootstrapped and regtested on x86_64-linux, comes with a testcase. OK 
> for mainline ?
> 
> FX
> 
> 
> 
> :ADDPATCH fortran:
OK,

Jerry



More information about the Fortran mailing list