This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/49918] New: Spurious -Wconvert warnings when using a BOZ data statement


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]