fortran-lang/stdlib

File /stdlib/example/linalg/example_sparse_from_ijv.f90

tof92130 opened this issue · 4 comments

Motivation

/stdlib/example/linalg/example_sparse_from_ijv.f90

line 38 to compile with gfortran-14.2.0:

print '(3I4,x,3f8.1)', ELL%index(i,:) , ELL%data(I,:)
sourd be:

print '(3I4,1x,3f8.1)', ELL%index(i,:) , ELL%data(i,:)

Prior Art

No response

Additional Information

No response

This looks like a style typo, cc @jalvesz?

The current line is

print '(3I4,x,3f8.1)', ELL%index(i,:) , ELL%data(i,:)

So I guess the comment is about the white space formatter x vs 1x ? If so, sure, I did not realize as both run with all compilers tested including gfortran 14.2. I see no problem changing it for 1x.

Thanks for reporting this @tof92130.

I think that the whitespace specifier must have a numeral in front to be standard.

print '(I0,X,I0)', 5, 6
end

Compiled with gfortran -Wall -pedantic you get the message:

    1 | print '(I0,X,I0)', 5, 6
      |          1
Warning: GNU Extension: X descriptor requires leading space count at (1)
Compiler returned: 0