- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi,
I'd like to see the Intel Fortran compiler at least give a warning if a PRIVATE TYPE is used for a PUBLIC declaration, viz,
% cat > pub_var_private_type.f90 << EOF
module pub_var_private_type
type, private :: private_type
integer :: sample
end type
type(private_type), public :: var ! should produce error
end module
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check pub_var_private_type.f90
[no complaints]
It's antecedent does:
alpha% fort -what
Compaq Fortran V1.2.0-1882
Compaq Fortran Compiler V1.2.0-1882-48BBF
alpha%fort -c pub_var_private_type.f90
f90: Error: pub_var_private_type.f90, line 5: This entity cannot be PUBLIC since its derived type is PRIVATE. [VAR]
type(private_type), public :: var ! should produce error
--------------------------------^
Thanks for consideration,
--
Bil, 757.812.1805
I'd like to see the Intel Fortran compiler at least give a warning if a PRIVATE TYPE is used for a PUBLIC declaration, viz,
% cat > pub_var_private_type.f90 << EOF
module pub_var_private_type
type, private :: private_type
integer :: sample
end type
type(private_type), public :: var ! should produce error
end module
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check pub_var_private_type.f90
[no complaints]
It's antecedent does:
alpha% fort -what
Compaq Fortran V1.2.0-1882
Compaq Fortran Compiler V1.2.0-1882-48BBF
alpha%fort -c pub_var_private_type.f90
f90: Error: pub_var_private_type.f90, line 5: This entity cannot be PUBLIC since its derived type is PRIVATE. [VAR]
type(private_type), public :: var ! should produce error
--------------------------------^
Thanks for consideration,
--
Bil, 757.812.1805
- Marcas:
- Intel® Fortran Compiler
Link copiado
4 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Upon reading the GCC bug report, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40089, it seems that this might just be the old Fortran 95 fort compiler complaining whereas F2003 allows this?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Correct - this was an enhancement in Fortran 2003. You can use -std95 if you want the warning.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Ah, yes, thanks. I read that one but missed the F95 subtlety.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado

Responder
Opções do tópico
- 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