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

Why do I get this warning message?

WSinc
New Contributor I
407 Views

Compiling with Intel Visual Fortran Compiler XE 12.0.4.196 [IA-32]...

color_cube.f90

D:\\Bills Data\\Documents\\Visual Studio 2008\\Projects\\contours\\contours\\color_cube.f90(6): warning #6075: The data type of the actual argument does not match the definition. [G$CLEARSCREEN]
**************************************************************************************
This is supposed to be the way that it's called according to the example
given. Is this a BUG?
**************************************************************************************
subroutine color_cube()

use ifqwin

integer*4 color,ires

integer*2 ix,iy,iz,ix1,iy1

do i=0,255

call clearscreen(G$CLEARSCREEN)

print *,"z level:"

read *,iz

if(iz.lt.0)return

do ix=0,255

do iy=0,255

color=z"ff000000"

color=or(color,ix * 2**16)

color=or(color,iy * 2**8 )

color=or(color,iz)

! set 3x3 rect to same color

do 15 ix1=ix*3,ix*3+2

do 15 iy1=iy*3,iy*3+2

15 ires=setpixelrgb(ix1,iy1,color)

end do

end do

read(*,*)

end do

end subroutine

0 Kudos
3 Replies
IanH
Honored Contributor II
407 Views
You get the warning because the type of the actual argument is REAL due to the default implicit typing rules, but the procedure wants an INTEGER(4).

Try again with the correct spelling of the actual argument to the clearscreen call (the $ comes first).

Consider using IMPLICIT NONE.
0 Kudos
WSinc
New Contributor I
407 Views
HI -

I see my mistake, but I was wondering -

Why did it clear the screen anyway, just like it was supposed to?

That's what threw me off, anyway.
Is an uninitialized variable supposed to do that?

Yours; Bill
0 Kudos
mecej4
Honored Contributor III
407 Views
> Is an uninitialized variable supposed to do that?

An uninitialized variable may not be supposed to do or not do anything.

In your example not only was the variable uninitialized, but it was also of the wrong type. If the real variable in memory, when interpreted as an integer by the library routine, happened to have a value that made sense to the library routine, there will be no error message and the screen gets cleared.

On some other day, with a different garbage value for the uninitialized variable, the outcome may be different. That is the nature of uninitialized variables and programs that employ them.
0 Kudos
Reply