- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correct - this was an enhancement in Fortran 2003. You can use -std95 if you want the warning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, yes, thanks. I read that one but missed the F95 subtlety.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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