public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19387] New: Fortran compiler tries to print HOST_WIDE_INT with %d format
@ 2005-01-11 23:37 sje at cup dot hp dot com
  2005-01-12  1:43 ` [Bug fortran/19387] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sje at cup dot hp dot com @ 2005-01-11 23:37 UTC (permalink / raw)
  To: gcc-bugs

In trans-common.c there are two calls to gfc_warning that pass a HOST_WIDE_INT
variable and a %d format.  The calls in question are in translate_common, where
we call gfc_warning with the variable 'offset' and again with the variable
'common_segment->offset'.  This will not work when HOST_WIDE_INT is not the same
size as int.  I tried replacing '%d' in the format with the macro
HOST_WIDE_INT_PRINT_DEC, which is defined in gcc/hwint.h but that failed because
the routine error_print in gcc/fortran/error.c parses the format string and
doesn't understand %ld or %lld.

Test case:

      real r1(5)
      common r1
      double precision d1
      equivalence (d1, r1(2))
      end

Output during compile:

Warning: COMMON '__BLNK__' at (1) requires 1074534272 bytes of padding at start

-- 
           Summary: Fortran compiler tries to print HOST_WIDE_INT with %d
                    format
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sje at cup dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19387


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-11  0:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-11 23:37 [Bug fortran/19387] New: Fortran compiler tries to print HOST_WIDE_INT with %d format sje at cup dot hp dot com
2005-01-12  1:43 ` [Bug fortran/19387] " pinskia at gcc dot gnu dot org
2005-01-14 23:08 ` pinskia at gcc dot gnu dot org
2005-04-11  0:38 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).