- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I discovered a bug in my code where a subroutine was expecting an array of integer*8 as an argument and was being passed an array of integer*4 and bad things started happening in the latter half of the array. After fixing this I began to wonder why the compiler did not catch this and save me from a morning of debugging. I tried compiler flags -check all and -warn all and still got nothing. Is there a way to check for the correctness of argument types? I'm using ifort 16.0.0 for Linux.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-warn all includes -warn interface, which can warn you about such things, but it is dependent on the compilation order. If the calling routine is compiled before the called routine, it won't detect a mismatch. Best practice is to have all called procedures in modules - this guarantees that argument checking will occur.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page