- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good Morning Everyone,
Can someone tell me what does the following two settings do (in Properties Pages: Fortran: Data)
1. Initialize Local Saved Scalars to Zero
2. Initialize local variables to NaN
I would like to make sure that all the variables used in a program were initialized (set to zero) before any calculation. Do I set both to 'YES', the default is 'NO'? Thanks in advance.
Tom Lin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nevertheless, the best way to initialize all variables is to correct your code so that it does it itself. Don't rely on compiler switches to cover up for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also don't forget about the compiler option:
/RTCu report use of variable that was not initialized
But that is a runtime check
Steve, maybe you can add to the compiler wish list an option that will make a compile time test for use of uninitialized variable. Yes, I know, due to program flow you might not be able to detect all instances of use before initialization but this option will catch the bulk of the uninitialized variable instances.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page