Can't make sense of runtime warnings

Can't make sense of runtime warnings

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

-Zaak
13 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

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.

Steve

I did pass -traceback when compiling and linking! Possible bug?

Thanks for looking at this.

-Zaak

Can you provide a test case?

Steve

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:

integer, target :: array(100)
integer, pointer :: p(:)

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

Steve

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!

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

Steve

Add option

-check:noarg_temp_created

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

Jim Dempsey

www.quickthreadprogramming.com

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?

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.

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.

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.

Steve
Best Reply

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

Steve

Melden Sie sich an, um einen Kommentar zu hinterlassen.