- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
there is no diagnostics generated for the following code:
print *, pack ( array=[1,2],mask=.true.,vector=[0] ) ! Illegal
neither at compile nor at run-time even with "-check all" specified.
The standard requires that the size of vector in the above case has to be at least as large as array.
Best regards,
Harald
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for post. I reported this to our Fortran Developers for further consideration (under the internal tracking id below) of issuing either a run-time or compile-time diagnostic. You are correct, when mask is a scalar with value true, vector must have at least as many elements as there are in array.
(Internal tracking id: DPD200238475)
(Resolution Update on 11/27/2013): This defect is fixed in the Intel Fortran Composer XE 2013 SP1 Initial Release (2013.1.0.080 - Linux)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The missing diagnostic is now fixed in the Composer XE 2013 SP1 Release. This was initially fixed in the 2013.1.0.080 (Linux) release in September.
In addition to the noted new diagnostic, the Developer indicates ifort also now issues an error diagnostic when the MASK is a SCALAR TRUE and the number of elements in the VECTOR is less than the number of elements in the ARRAY.
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728
$ ifort t.F90 -check all -warn all
t.F90(2): error #8664: When MASK is a scalar with value true, VECTOR must have at least as many elements as there are in ARRAY.
print *, pack ( array=[1,2],mask=.true.,vector=[0] ) ! Illegal
-------------------------------------------------^
compilation aborted for t.F90 (code 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin,
I can confirm that the compiler now issues the desired diagnostics.
Thanks for this improvement!
Harald
Kevin Davis (Intel) wrote:
In addition to the noted new diagnostic, the Developer indicates ifort also now issues an error diagnostic when the MASK is a SCALAR TRUE and the number of elements in the VECTOR is less than the number of elements in the ARRAY.
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728$ ifort t.F90 -check all -warn all
t.F90(2): error #8664: When MASK is a scalar with value true, VECTOR must have at least as many elements as there are in ARRAY.
print *, pack ( array=[1,2],mask=.true.,vector=[0] ) ! Illegal
-------------------------------------------------^
compilation aborted for t.F90 (code 1)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page