I got this message when implemented slider %sl which calls function SliderFunction. The demo is here, but this demo works fine, itis the main code which crashes
module mod111
integer kBusySliding
real*8 SliderVariable
CONTAINS
Integer function SliderFunction ()
if(kBusySliding.eq.1) goto 10000
kBusySliding = 1
a=2.3
Do i=1,5000000
a=log(exp(a))
enddo
print*, a
kBusySliding = 0
10000 continue
SliderFunction=2
end function
end module mod111
!=============================
PROGRAM aaa
use mod111
kBusySliding = 0
i=winio@('%60^sl', SliderVariable, 0d0, 1d0, SliderFunction)
end program
Inside this function goes some calculation but seems during mouse movement the slider calls this function hundreds times and way before the calculation inside the function SliderFunction ends. Despite that i implemented for such exact cases the measure (see the trick introducing variable kBusySliding) to prevent any new computations before previous ones complete (and may cause problems due to that), this time the crash happens exactly on the first line of function SliderFunction before doing anything
Questions:
- How to get rid of this crash? Though i admit that though the compiler is strict and absolutely right, but in this specific case i do not care about possible problems with the recursion, i just do not want it to crash. I will prevent potential collisions myself with kBusySliding trickery which worked perfectly for decades
- What means -ANSI mode warning in this case ? Good that such warning exists though i do not find it enough verbose to tell me more hints. With -ANSI this program even does not compile, so what for this -ANSI warning was made?
This demo example above works OK both with 64 and 32bits.