Software Archive
Read-only legacy content
17061 Discussions

Safest Compile options

Intel_C_Intel
Employee
635 Views
I have program that I am compiling which is fairly large. The program stores integers and floats in a single array. So, I pass float into subroutines and recieve as integer.

I am debugging a problem where integer is passed into a subroutine. The integer is changed. Then the returned integer is clobbered.

I would like to try the safest compile options but I am not sure about the combinations.

I Compile with:
/debug:full /nooptimize

And I link with:

/debug machine:386

I thought about /static but that seems to be on be default.
Also, is there a flag to print all the defaults?

Rudy
0 Kudos
4 Replies
Steven_L_Intel1
Employee
635 Views
I don't think compiler options are going to help you. You may be done in by the X86 processor's use of extended precision registers that can modify the value of things typed as REAL. You wouldn't notice this (usually) if everything was REAL, but if you have integers pretending to be reals, you'll get into trouble quickly.

I don't know what you mean by "the returned integer is clobbered"

Generate a source listing to see what options are used.

Steve
0 Kudos
Intel_C_Intel
Employee
635 Views
here's the example:

subroutine one(n1,n2,n3,n4)  
n1=0  
call two (n1,n2)  
print *,n1     gives n1="5836598" n1 is clobbered  
return  
end  
subrroutine two(n1)  
n1=n1+0  
print *,n1   gives n1="0"  asexpected  
return  
end
0 Kudos
Steven_L_Intel1
Employee
635 Views
The code you have posted won't compile - ignoring the typo (unless you specify non-default options such as /iface:cref). You call routine TWO with two arguments, but it takes only one. What does your code REALLY look like?

I suggest you send a ZIP file of a project that demonstrates the problem to us at vf-support@compaq.com, and we'll be glad to take a look.

Steve
0 Kudos
Intel_C_Intel
Employee
635 Views
thanks for the offer. I have things working now. The code is too large to send and have you be able to make sense out of it. Also, I use makefiles. I don't hvae the swing of progects yet.

Rudy
0 Kudos
Reply