- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have fiddling with the compiler options in Visual studio to try and get some better diagnostics on my code. In particular I am wanting the compiler to check such things as:
- unused variable declarations
- unused COMMON blocks
- correct arguments in subroutine calls
Are their compiler options for these things?
Also, how do I restore the default compiler options for release/debug configurations?
Also, how do I restore the default compiler options for release/debug configurations?
Thanks
Simon
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is an option /warn:unused that will complain about unused declared variables. The option /warn:interface, which is on by default in a Debug configuration, will check argument consistency. There isn't an option that will check for unused COMMON blocks.
The /warn options are on the Diagnostics property page.
There is not an automated way of resetting project properties.
The /warn options are on the Diagnostics property page.
There is not an automated way of resetting project properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
I have these options switched on, but I'm not getting any warnings. The code has a lot fo undeclared variables, and I have introduced a bug in the form of a missing argument in a subroutine call, but it's not reporting these. The build is producing no errors or warnings. And the *.diag file is empty, and the build log doesn't have any errors of warnings either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the build log:
------ Build started: Project: FWNProject2, Configuration: Debug|Win32 ------ Compiling with Intel Fortran Compiler 10.0.025 [IA-32]... ifort /nologo /Zi /Od /assume:nocc_omp /extend_source:132 /Qdiag-file:"Debug\fwnd.diag" /warn:all /fpe:0 /module:"Debug\" /object:"Debug\" /traceback /check:bounds /check:uninit /libs:static /threads /dbglibs /c /extfor:f /Qvc8 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio 8\VC\bin" "L:\Simon\FWN\FWNProject2\FWNProject2\opkda1.f" ifort /nologo /Zi /Od /assume:nocc_omp /extend_source:132 /Qdiag-file:"Debug\fwnd.diag" /warn:all /fpe:0 /module:"Debug\" /object:"Debug\" /traceback /check:bounds /check:uninit /libs:static /threads /dbglibs /c /extfor:f /Qvc8 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio 8\VC\bin" "L:\Simon\FWN\FWNProject2\FWNProject2\opkda2.f" ifort /nologo /Zi /Od /assume:nocc_omp /extend_source:132 /Qdiag-file:"Debug\fwnd.diag" /warn:all /fpe:0 /module:"Debug\" /object:"Debug\" /traceback /check:bounds /check:uninit /libs:static /threads /dbglibs /c /extfor:f /Qvc8 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio 8\VC\bin" "L:\Simon\FWN\FWNProject2\FWNProject2\femwaterN7.f" ifort /nologo /Zi /Od /assume:nocc_omp /extend_source:132 /Qdiag-file:"Debug\fwnd.diag" /warn:all /fpe:0 /module:"Debug\" /object:"Debug\" /traceback /check:bounds /check:uninit /libs:static /threads /dbglibs /c /extfor:f /Qvc8 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio 8\VC\bin" "L:\Simon\FWN\FWNProject2\FWNProject2\opkdmain.f" Linking... Link /OUT:"Debug\FWND.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST:NO /DEBUG /PDB:"L:\Simon\FWN\FWNProject2\FWNProject2\debug\fwnd.pdb" /SUBSYSTEM:CONSOLE "Debug\opkda1.obj" "Debug\opkda2.obj" "Debug\femwaterN7.obj" "Debug\opkdmain.obj" Link: executing 'link' FWNProject2 - 0 error(s), 0 warning(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh - you're using 10.0! You willl also have to add /gen-interface under Command Line > Additional Options. This may not work well in that old release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does that do? I added it and now I'm getting a fatal error (Code 1) on the first line of the code, which is a comment line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In version 10 (which is several years old), that would cause the creation of generated interfaces that the /warn:interface option would check. In the current version 12 (aka Intel Visual Fortran Composer XE 2011), /warn:interface implies /gen-interface.
There were many bugs related to this feature in earlier versions of the compiler, and you evidently hit one. Please obtain and use a current compiler version for best results.
There were many bugs related to this feature in earlier versions of the compiler, and you evidently hit one. Please obtain and use a current compiler version for best results.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page