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

Question of using "ZeroMemory" in IVF8.0

Zhanghong_T_
Novice
993 Views
In CVF6.6, I have a simple code:
use dfwbase
real*8,allocatable::aa(:)
allocate(aa(1000000))
call ZeroMemory(loc(aa), 1000000*sizeof(real*8))
END
But in IVF8.0, it can not run correctly. Who can tell me where it is wrong?
Thanks!
0 Kudos
5 Replies
Jugoslav_Dujic
Valued Contributor II
994 Views

That compiles? Maybe, if you don't have IMPLICIT NONE.

In CVF/IF, SIZEOF() cannot take a type-name as an argument. You must use an actualvariable instead:

call ZeroMemory(loc(aa), sizeof(aa))

Compiler interprets your actual code as a variable named REAL multiplied by 8.

Jugoslav

0 Kudos
Zhanghong_T_
Novice
994 Views

Thank you for your reply! I have modified just like what you have said, but it still can not work!

In fact, in IVF8.0, I have replaced the use dfwbase with use kernel32(it is wrong when I don't replace this code).

0 Kudos
Jugoslav_Dujic
Valued Contributor II
994 Views
Could you elaborate on "don't work"?
0 Kudos
Zhanghong_T_
Novice
994 Views

When I use dfwbase in IVF8.0,

the compiler display the following error when linking:

unresolved external symbol ZEROMEMORY@8
When I replaced it with use kernel32 and debug it(run to the last line), it display:
Unhandled exception in test.exe: 0xC0000005: Access Violation when read 0x00000000.
the display is Chinese, I have translated it to English.
0 Kudos
Zhanghong_T_
Novice
994 Views
Anyone help me?
Thanks!
0 Kudos
Reply