This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/43217] Output of Hollerith constants which are not a multiple of 4 bytes
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2010 09:50:03 -0000
- Subject: [Bug fortran/43217] Output of Hollerith constants which are not a multiple of 4 bytes
- References: <bug-43217-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2010-03-02 09:50 -------
For DATA gfortran already pads the Hollerith constant; maybe the simplest would
be to modify primary.c's match_hollerith_constant to simply add tailing spaces
such that the length is multiples of the storage size of, e.g., a default
integer - or of gfc_numeric_storage_size? (They are not the same).
Something like
chunk_size = gfc_integer_kinds[gfc_default_integer_kind].bit_size
/gfc_char_kinds[gfc_default_char_kind].bit_size;
extra_size = num % chunk_size;
size = num + 1 + (extra_size > 0) ? chunk_size - extra_size : 0;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43217