- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Consider the following program:
[fortran]
program test
print*,ibset(1,65)
end program test
[/fortran]
Here's the result:
[bash]
$ ifort -o test test.f90
$ ./test
3
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.0.1.117 Build 20121010
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
[/bash]
Shouldn't the compiler throw an error in such cases?
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
ifort -stand sk.f
program test
^
sk.f(2): warning #7376: Standard F2003 requires POS, the 2nd argument, be less than BIT_SIZE of I, the 1st argument. [IBSET]
print*,ibset(1,65)
--------------^
Is your point that the code should be rejected regardless of option setting?
gfortran sk.f
sk.f:2.22:
print*,ibset(1,65)
1
Error: 'pos' at (1) must be less than BIT_SIZE('i')
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Yeah, I would expect it to do so, like gfortran does. I was not aware that the requirement POS < BIT_SIZE was introduced only in F2003 though.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The -stand option defaults to checking against f2003. I expect the similar warning if you set checking against other standards.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You are likely to find many cases where the default in Intel Fortran is to let you express things not supported by the standard. Usually this is for historical compatibility. In such cases asking for standards checking gets you additional diagnostics.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks for the clarification, I'll start using -stand to this end from now on. One more marginally related question: can the -stand option interfere in any way with optimization?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
It's not supposed to - it enables additional diagnostics only and does not change compiler semantics. There have been compiler bugs in the past where it did, but I am not aware of any cases nowadays.

- 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