- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Does Intel Fortran have a compiler option that forces static numeric variables to be initialised to zero?
I have seen the /Qzero and /Qtrapuv options. However, they don't seem to fit the bill.
Alternatively, is there an option to cause warning to be produced if a variable is used without having been initialised? I can understand that C compilers can do this because goto is rare in C. I'm not sure whether such a warning is possible in Fortran where goto might be present.
Thanks for your attention.
Leigh.
I have seen the /Qzero and /Qtrapuv options. However, they don't seem to fit the bill.
Alternatively, is there an option to cause warning to be produced if a variable is used without having been initialised? I can understand that C compilers can do this because goto is rare in C. I'm not sure whether such a warning is possible in Fortran where goto might be present.
Thanks for your attention.
Leigh.
- Balises:
- Intel® Fortran Compiler
1 Solution
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi Leigh,
I think that you have to also use the /Qsave option (save local variables in static allocation ) with the /Qzero option. However you did not mention which version of the compiler you are using.
Concerning the use of local, uninitialized variables, the compiler shouldnormally give you some warning message.
Phil.
Lien copié
3 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi Leigh,
I think that you have to also use the /Qsave option (save local variables in static allocation ) with the /Qzero option. However you did not mention which version of the compiler you are using.
Concerning the use of local, uninitialized variables, the compiler shouldnormally give you some warning message.
Phil.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
The version is 2011.0.14.
I should also say that the body of code I am working on is legacy code. These variables are also at the program level. Does /Qsave have an effect on those.
Thanks,
Leigh.
The version is 2011.0.14.
I should also say that the body of code I am working on is legacy code. These variables are also at the program level. Does /Qsave have an effect on those.
Thanks,
Leigh.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The compiler offers run-time errors for uses of uninitialized local variables through /check:uninit. It has some limitations.
/Qtrapuv, in its current implementation, does nothing useful.
/Qtrapuv, in its current implementation, does nothing useful.
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable