Missing diagnostics for invalid PACK() arguments

Missing diagnostics for invalid PACK() arguments

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

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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)

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)

Kevin,

I can confirm that the compiler now issues the desired diagnostics.

Thanks for this improvement!

Harald

Citação:

Kevin Davis (Intel) escreveu:

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)

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!