- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'd like to see the Fortran Intel compiler at least give a warning if a string concatenation does not contribute to the result, viz,
% cat > non_contributing.f90 << EOF
program non_contributing
character(10) :: command
character(100) :: middle = 'begin'
command = middle//'end'
print*,command
end program
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check non_contributing.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 non_contributing.f90
f90: Warning: non_contributing.f90, line 4: Expression does not contribute to result
command = middle//'end'
------------------^
Thanks for consideration,
--
Bil, 757.812.1805
I'd like to see the Fortran Intel compiler at least give a warning if a string concatenation does not contribute to the result, viz,
% cat > non_contributing.f90 << EOF
program non_contributing
character(10) :: command
character(100) :: middle = 'begin'
command = middle//'end'
print*,command
end program
EOF
% ifort --version | head -1
ifort (IFORT) 12.1.3 20120212
% ifort -c -warn -check non_contributing.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 non_contributing.f90
f90: Warning: non_contributing.f90, line 4: Expression does not contribute to result
command = middle//'end'
------------------^
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:
% gfortran --version | head -1
GNU Fortran (GCC) 4.6.2 20111019 (prerelease)
% gfortran -c -Wall non_contributing.f90 non_contributing.f90:4.25:
command = middle//'end'
1
Warning: CHARACTER expression will be truncated in assignment (10/103) at (1)
% gfortran --version | head -1
GNU Fortran (GCC) 4.6.2 20111019 (prerelease)
% gfortran -c -Wall non_contributing.f90 non_contributing.f90:4.25:
command = middle//'end'
1
Warning: CHARACTER expression will be truncated in assignment (10/103) at (1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestion. I know that DEC/Compaq Fortran did give such a warning. I have entered a feature request for you, the ID is DPD200234070.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent; thanks.
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