Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran 77 Initialize Variables at Compile Time

Status
Not open for further replies.

fastwink

Programmer
Jan 11, 2005
1
US
I need to force all variables to default to zero.
Some compilers have the option, but I have not found
this to be true for SUN Forte compiler. Is there
an easy way (maybe an option in the code)?

I have legacy source code and dread setting all variables to zero, but may have to do so.
 
You mean you want the opposite of -xcheck.

There isn't one as such. You can initialize the global ones (i.e. common blocks) in a block data segment. Everything else can be initialized with either /0/ after the variable name or in a DATA statement.

Yes - it is tedious. -xcheck will help you find the ones that have not been initialized.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top