Groups
Groups
Sign in
Groups
Groups
GNU Fortran
Conversations
About
Send feedback
Help
Unassigned variable warning?
19 views
Skip to first unread message
Jim Green
unread,
Jun 27, 2017, 4:40:09 PM
6/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to GNU Fortran
Does gfortran have any compiler option to flag the "b = a" line below:
program Main
character(len=1) :: a,b
b = a
end program Main
Lahey Fortran produces "a is used but never set." "-Wall" says nothing.
Using MinGW.
TIA.
Beliavsky
unread,
Jun 27, 2017, 4:46:43 PM
6/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to GNU Fortran
Try using -Wextra in addition to -Wall.
For GNU Fortran (GCC) 8.0.0 20170430 (experimental) from Equation.com on Windows I get the following results
for the code you posted:
c:\fortran\test>gfortran -Wall -Wextra xxuninit.f90
xxuninit.f90:3:0:
b = a
Warning: 'a[1]{lb: 1 sz: 1}' is used uninitialized in this function [-Wuninitialized]
Reply all
Reply to author
Forward
0 new messages