Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28455 Discussions

Can't make sense of runtime warnings

Izaak_Beekman
New Contributor II
856 Views
I compiled a code with quite a few flags, among them the -warn all and -check all flags. Also with -prof-gen (to generate code coverage information) -g, -traceback, and a few others. At run time I see a lot of the following messages:

forrtl: warning (402): fort: (1): In call to I/O Read routine, an array temporary was created for argument #2
forrtl: warning (402): fort: (1): In call to I/O Write routine, an array temporary was created for argument #3

Do you think these warnings are generated because of the -warn and -check flags?

Is there a way to get line number information in the source file? It seems 402 is a warning number not a source line.

What is meant by argument #n? If I have a read statement: read(*,*) a, b, c is argument, say, #2 b? Is there a reason why it never shows argument #1 in the warnings?

Thanks,
-Z
0 Kudos
1 Solution
Steven_L_Intel1
Employee
856 Views

The "temp created" diagnostics now will include a traceback with the 15.0 compiler.

View solution in original post

0 Kudos
12 Replies
Steven_L_Intel1
Employee
856 Views
This is -check arg_temp_created. I have never seen this mention I/O routines before, but... If you add -traceback you should get line numbers.
0 Kudos
Izaak_Beekman
New Contributor II
856 Views
I did pass -traceback when compiling and linking! Possible bug?

Thanks for looking at this.
0 Kudos
Steven_L_Intel1
Employee
856 Views
Can you provide a test case?
0 Kudos
Steven_L_Intel1
Employee
856 Views
I just tried an example and could get it to show argument #1 - at least for a WRITE. It corresponded to the variable in the I/O list. I did not get a traceback either - I will ask about that. Issue ID is DPD200158137 - this is a feature request.

Here was my test case:

[fortran]integer, target :: array(100)
integer, pointer :: p(:)

array = 3
p => array(1:99:2)
write (1,*) p
end

[/fortran]
0 Kudos
Brett_Benowitz
Beginner
856 Views

Hi - I know this is an old thread but I just got the same warning, without an traceback either.   Has the issue been resolved at all?  Not sure how to look up that Issue ID#.

Thanks!

0 Kudos
Steven_L_Intel1
Employee
856 Views

You can't look up that issue ID. We haven't yet released a version that gives a traceback for that run-time warning.

0 Kudos
jimdempseyatthecove
Honored Contributor III
856 Views

Add option

-check:noarg_temp_created

to disable this warning message (which was added when you enabled all warnings).

Jim Dempsey

0 Kudos
Mark_B_5
Beginner
856 Views

I just installed ifort version 13.1.1 on my Linux Cluster and get this on runtime no matter what compiler options I use (-nocheck, -check noarg_temp_created, -w, etc) for compiling the main program or module containing the function:

function crs8(a,b) result(c)
  real(8), intent(in) :: a(3),b(3)
  real(8) :: c(3)
  c(1)= a(2)*b(3)-a(3)*b(2)
  c(2)=-a(1)*b(3)+a(3)*b(1)
  c(3)= a(1)*b(2)-a(2)*b(1)
end function crs8

forrtl: warning (402): fort: (1): In call to VECTOR^CRS8, an array temporary was created for argument #1

forrtl: warning (402): fort: (1): In call to VECTOR^CRS8, an array temporary was created for argument #2

This is extremely annoying.  What do I need to be doing differently?

0 Kudos
Anonymous66
Valued Contributor I
856 Views

You get this warning when compiling with "-check noarg_temp_created" or -nocheck? If so this is likely a bug. Could you attach a program which reproduces the problem? This will help us investigate the issue.

0 Kudos
IanH
Honored Contributor II
856 Views

Separate to the warning being triggered when not requested - you may find that making the dummy arguments assumed shape (:) rather than explicit shape avoids the need for temporaries.

0 Kudos
Steven_L_Intel1
Employee
856 Views

Note that you have to disable (or not enable) this option when compiling the source that calls the function. It isn't looked at when you compile the called function itself.

0 Kudos
Steven_L_Intel1
Employee
857 Views

The "temp created" diagnostics now will include a traceback with the 15.0 compiler.

0 Kudos
Reply