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

Sleep

llynisa
Beginner
451 Views
Can anyone please explain an oddity that I have come across?

In a Windows program, where I (normally) document all WinAPIs & constants from modules by USE ONLY statements, I accidentally left out the WinAPI Sleep from the kernel32 list.

It compiled without complaint, but in execution the statement:

call Sleep(500)

resulted in a sleep of 500 seconds rather than 500ms. When I put Sleep into the kernel32 USE ONLY list, it went back to the expected 500ms.

Why did it compile?
Where did it grab Sleep from when it was not in the USE ONLY list?

Puzzled as usual,

Alan
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
451 Views
It's SLEEP from portability library dfport.lib (portlib). Quote from docs:

To prevent DFPORT.LIB library from being passed to the linker, specify the /fpscomp:nolibs option.

Jugoslav
0 Kudos
llynisa
Beginner
451 Views
Jugoslav,

Thanks once more - I must examine dfport to see what other surprises it has in store.

Regards

Alan
0 Kudos
Reply