This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25486] [4.1/4.2 Regression] fortran fixed-form literal character constant not padded.
- From: "aldot at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Dec 2005 13:15:21 -0000
- Subject: [Bug fortran/25486] [4.1/4.2 Regression] fortran fixed-form literal character constant not padded.
- References: <bug-25486-10110@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from aldot at gcc dot gnu dot org 2005-12-27 13:15 -------
I'm bootstrapping and will test the patch below (gcc.gfortran.pr25486.0.diff).
I'm uncertain on the expected results of the testcase above for
-ffixed-line-length-none, so i'm not changing the behaviour for this case (i.e.
no padding).
2005-12-27
PR fortran/25486
* scanner.c (load_line): use maxlen to determine the line-length used
for padding lines in fixed form.
Index: gcc/fortran/scanner.c
===================================================================
--- gcc/fortran/scanner.c (revision 109080)
+++ gcc/fortran/scanner.c (working copy)
@@ -809,11 +809,13 @@ load_line (FILE * input, char **pbuf, in
/* Pad lines to the selected line length in fixed form. */
if (gfc_current_form == FORM_FIXED
- && gfc_option.fixed_line_length > 0
+ && gfc_option.fixed_line_length != 0
&& !preprocessor_flag
&& c != EOF)
- while (i++ < gfc_option.fixed_line_length)
- *buffer++ = ' ';
+ {
+ while (i++ < maxlen)
+ *buffer++ = ' ';
+ }
*buffer = '\0';
*pbuflen = buflen;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25486