- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'd like to see the Intel compiler at least give a warning
if arguments are given out of order, viz,
% cat > argument_order.f90 << EOF
subroutine test_arg_order( nvals, array )
implicit none
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
integer, intent(in) :: nvals
print*, array, nvals
end subroutine
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check argument_order.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 argument_order.f90
f90: Error: argument_order.f90, line 3: This name does not have a type, and must have an explicit type. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
f90: Error: argument_order.f90, line 3: A specification expression is invalid. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
Thanks for consideration,
--
Bil, 757.812.1805
I'd like to see the Intel compiler at least give a warning
if arguments are given out of order, viz,
% cat > argument_order.f90 << EOF
subroutine test_arg_order( nvals, array )
implicit none
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
integer, intent(in) :: nvals
print*, array, nvals
end subroutine
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check argument_order.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 argument_order.f90
f90: Error: argument_order.f90, line 3: This name does not have a type, and must have an explicit type. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
f90: Error: argument_order.f90, line 3: A specification expression is invalid. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
Thanks for consideration,
--
Bil, 757.812.1805
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And so does gfortran, viz,
% gfortran --version | head -1
GNU Fortran (GCC) 4.6.2 20111019
% gfortran -c -pedantic-errors argument_order.f90
argument_order.f90:3.21:
integer, dimension(nvals), intent(in) :: array
1
Warning: Extension: Symbol 'nvals' is used before it is typed at (1)
% gfortran --version | head -1
GNU Fortran (GCC) 4.6.2 20111019
% gfortran -c -pedantic-errors argument_order.f90
argument_order.f90:3.21:
integer, dimension(nvals), intent(in) :: array
1
Warning: Extension: Symbol 'nvals' is used before it is typed at (1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We decided to allow this as an extension, but in a release later this year we'll give a standards warning for it:
t.f90(3): warning #8586: Implicit type is given to allow out-of-order declaration. Non-standard extension. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
t.f90(3): warning #8586: Implicit type is given to allow out-of-order declaration. Non-standard extension. [NVALS]
integer, dimension(nvals), intent(in) :: array ! use nvals before declared
---------------------^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent news (about the standards warning in a release later this year)!
Thanks,
--
Bil
Thanks,
--
Bil

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