This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49918] New: Spurious -Wconvert warnings when using a BOZ data statement
- From: "david.schanen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Jul 2011 20:47:10 +0000
- Subject: [Bug fortran/49918] New: Spurious -Wconvert warnings when using a BOZ data statement
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49918
Summary: Spurious -Wconvert warnings when using a BOZ data
statement
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: david.schanen@gmail.com
On GNU/Linux x86_64 systems gfortran issues warnings about converting from
INTEGER(16) that appear to be spurious when the -Wconversion flag is enabled.
Example program:
program data_test
implicit none
integer(kind=4) :: bits4
integer(kind=2) :: bits2
integer(kind=16) :: bits16
data bits4 /Z"7F800000"/
data bits2 /Z"7F80"/
data bits16 /Z"7F80000000000000"/
end program data_test
The first 2 data statements cause a warning, but the last one does not. It
appears the compiler assumes all data statements are 16 bytes long, regardless
of the actually length of the data statement. I'm not sure of the status of
this on other platforms.