| View previous topic :: View next topic |
| Author |
Message |
gunther
Joined: 26 Aug 2004 Posts: 1
|
Posted: Thu Aug 26, 2004 8:44 am Post subject: detecting assignment of uninitialized variables |
|
|
Hi all -
Just finished tracking down an f90 problem that turned out to have an assignment of an uninitialized variable at its root. I'm used to SGI compilers where -DEBUG:trap_uninitialized=ON at least allows for quick checking for uninitialized floats and pointers. I haven't been able to figure out an equivalent debugging switch for pgf90 - anyone have a quick way to trap on these errors?
Thanks.
Gunther |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Thu Aug 26, 2004 5:52 pm Post subject: Try "-Mchkptr" |
|
|
Hi Gunther,
For pointers, pgf90 has a flag called "-Mchkptr" which will check if you are de-referencing a NULL pointer. "-Mbounds" will check for array out-of-bounds errors. However, there is not a flag to check for unitialized variables. Sorry.
- Mat |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Fri Aug 27, 2004 7:50 am Post subject: Future Feature |
|
|
Hi Gunther,
I was talking to our lead compiler architect about maybe adding something to the compiler to detect unitialized variables. He thinks it would be very useful so he'll put it list of possible new features. We don't know when it would make it into a release, however.
Thanks,
Mat |
|
| Back to top |
|
 |
Ron Cohen
Joined: 23 Aug 2005 Posts: 3
|
Posted: Tue Aug 23, 2005 10:03 am Post subject: uninitialized variables |
|
|
| I agree that it would be very valuable to have a compiler switch to test for uninitialized variables. Two switches would be useful, one that traps uninitailzied variables, and one that initializes variables to zero. |
|
| Back to top |
|
 |
|