- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Is there a way to have ifort look for uninitialized variables (maybe a debugging flag)?
Thanks - Ben
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
In Debug build there is a runtime option to check for use of un-initialized variables.
-QTrapuv and/or -RTCu
Jim Dempsey
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
No, not -Qtrapuv - pretend that doesn't exist. -check uninit will do some checking. The Static Analysis feature of Fortran Studio XE can do a good job of this.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
jimdempseyatthecove wrote:
-QTrapuv
This won't tell you that you have uninitialized variables but will likely cause runtime errors or garbage program output if you do have them. This flag causes your variables to start out with garbage values that will propagate through your code if you are not initializing them before use.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
-Qtrapuv isn't useful. What it does is cause floating point variables to be initialized to an "unusual value". It is not a NaN or anything else that would trigger an exception. I think using this reduces the chance of your finding errors and recommend against using it.

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora