<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79787>79787</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Formatted READ, after BN edit descriptor, of numeric field with only '.' non-blanks does not signal error condition (IOSTAT, ERR)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kiranktp
</td>
</tr>
</table>
<pre>
Consider below reproducer:
$ cat -n repro.F90
1 Program test_BN
2 Character(6) :: s
3 Real :: x
4 Integer :: stat
5 s = ' . '
6 Read(s,1,iostat=stat) x ! no digits present, error condition
7 Print '(F4.2,I6)',x,stat
8 Read(s,2,iostat=stat,BLANK='NULL') x
9 Print '(F4.2,I6)',x,stat
10 1 Format(BN,F12.3)
11 2 Format(F12.3)
12 End Program test_BN
A BN edit descriptor, or a BLANK='NULL' specifier in a READ statement, should result in an error condition when the F/E/D/EN/ES field consists of the decimal point alone. The words in the Standard are "The input field consists of an optional sign, followed by a string of one or more digits optionally containing a decimal point, including any blanks interpreted as zeros", not allowing for the possibility of decimal point alone.
llvm-flang, gcc, intel do not signal error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE1v4zYQ_TX0ZRBBGn9IOvjgyBGwaOAukvRcUOJIYkOTAknVcX99MbKz603SS3UYApo3X-8NKUPQvSXaivW9WO8XcoqD89tX7aV9jeOiceq8rZwNWpGHhow7gafROzW15MVyJ9K9SN8trqCVEe7sBZPUZXrxAH8ZwHfvei-PECnEP-8PN05kUw3SyzaSF1hsBJbABZY7CDfAJZsnkubd-XbjXLH5ZiP15H8ERxlvIGs2AcRyDwJzSICPG__mml8JLILAKhNYaTcnWe7nA0t446gMrAOlex0DjJ4C2SiwAvLeeWidVTpqZ29S52y-e23jXBOLepWgwOobzzr_qd4EVh8aLj40hJ8bqu4fd4ffxHIvMD_88fg45yp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