Issue 185381
Summary [Flang] Trailing comma in FORMAT specifier accepted by gfortran but rejected by Flang
Labels flang
Assignees
Reporter blazie2004
     Flang, while compiling the program
```
program t
  write(*,'(f3.0, )') 1.0
end program
```
throws this error 
```
Unexpected ',' before ')' in format _expression_
    write(*,'(f3.0, )') 1.0
 ^
```

While gfortran, when compiled with the flag `-fdec-blank-format-item`, successfully compiles the program with no errors. If the flag is not used, it emits:
```
  write(*,'(f3.0, )') 1.0
 1
Error: Missing item in format string at (1)
```
Should flang support this behavior similar to gfortran (-fdec-blank-format-item), or is the current rejection the intended behavior?
GNU Fortran documentation mentions that a comma with no following format descriptor may be permitted with -fdec-blank-format-item as a legacy DEC extension  , refernce link :[Commas-in-FORMAT-specifications]( https://gcc.gnu.org/onlinedocs/gcc-13.4.0/gfortran/Commas-in-FORMAT-specifications.html)




_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to