Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
3 Views

Zero-sized array constructor curiosity

Even the most underwhelming Christmas present needs wrapping

print *, [[integer::]]
end

But on Linux, ifort 16,17,18,19(.0.3):

error #7203: An ac-value-list of an array-constructor must contain at least one ac-value.
print *, [[integer::]]

Also gfortran 9.1.0:

 1 | print *, [[integer::]]
      |
internal compiler error: in gfc_typenode_for_spec, at fortran/trans-types.c:1120

Nobody likes underwhelming Christmas presents.

0 Kudos
7 Replies
Highlighted
New Contributor I
3 Views

Very interesting as Sgt

Very interesting as Sgt Schultz would have said. 

I suggest another beer 

0 Kudos
Highlighted
Black Belt
3 Views

Peculiar. The extra set of

Peculiar. The extra set of brackets seems to be the key here. Note that this isn't specifying a rank-two array, since:

If an ac-value is a scalar expression, its value specifies an element of the array constructor. If an ac-value is an array expression, the values of the elements of the expression, in array element order (9.5.3.2), specify the corresponding sequence of elements of the array constructor.

Both compilers are wrong here, in different ways. Please report this to Intel using the Online Service Portal  You can report it on Bugzilla against gfortran.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
New Contributor II
3 Views

Yeah, it is an interesting (.

Yeah, it is an interesting (...but also stupid) case, as the outer 'wrapping' brakets are pretty useless. I have reported it nevertheless. Thanks.

PS: concerning gfortran, this bug was reported in 2015 here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65428

0 Kudos
Highlighted
Black Belt
3 Views

I've been seeing gripes from

I've been seeing gripes from the few remaining gfortran developers that a lot of old, lower-priority bugs aren't getting worked on because there's no one to do so.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Moderator
3 Views

Thank you for your report.

Thank you for your report. This case has been escalated to compiler engineering.

Devorah - Intel® Developer Support
0 Kudos
Highlighted
New Contributor I
3 Views

Steve:

Steve:

What should it have done?

John

0 Kudos
Highlighted
Black Belt
3 Views

It should have printed a

It should have printed a blank line since the I/O list was an empty (zero-element) array. The code shown is functionally identical to:

print *, [integer::]
end

(Note only one set of brackets.) This is a zero-element array of default integer type/kind.

To make it a bit more obvious:

print *, [integer::[1,2,3],4,5]
end

should print:

1  2  3  4  5

(ignoring spacing)

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos