I don't know if this is not a bug but I found this will looking into 21300, take the following Fortran free formed code: if (abs(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).gt.999.d0.or.abs(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb).gt.99 9.d0.or.abs(cccccccccccccccccccc).gt.999.d0) THEN endif end program Note the if is all on the same line. We get an error (and a warning with -Wline-truncation) but I don't think free form should have a line lenght limit.
(In reply to comment #0) > We get an error (and a warning with -Wline-truncation) but I don't think > free form should have a line lenght limit. See 3.3.1 from the Standard. "In free source form, each source line may contain fomr zero to 132 characters and there are restrictions on where a statement (or portion of a statement) may appear within a line" I suppose we could implement a -fline-length=N type option.
(In reply to comment #1) > I suppose we could implement a -fline-length=N type option. Then lets call this an enhancement but note it blocks compiling OrbFit which works on XLF, Intel's and others.
Actually, we already have this, but only for fixed form. It should be no problem to generalize this to free form as well.
Created attachment 9444 [details] allow -ffixed-line-length in free form Is it ok to reuse -ffixed-line-length instead of introducing a new -fline-length or should -ffixed-line-length be renamed to -fline-length and -ffixed-line-length be made an alias for the then newly introduced -fline-length ?
Comment on attachment 9444 [details] allow -ffixed-line-length in free form correct description: it's about free form, not fixed form.
Created attachment 10199 [details] add -ffree-line-length-none -ffree-line-length-<n> http://gcc.gnu.org/ml/fortran/2005-10/msg00559.html 2005-09-11 Bernhard Fischer <rep.nop@aon.at> PR fortran/21302 * lang.opt: New options -ffree-line-length- and -ffree-line-length-none. * gfortran.h: Add free_line_length. * c-opts.c (c_common_handle_option): Ignore OPT_ffree_form and OPT_ffree_line_length_ when preprocessing. * options.c (gfc_init_options, gfc_handle_option): Initialize and set free_line_length and fixed_line_length. * scanner.c (load_line): Set free_line_length to 132 and fixed_line_length to 72 or user requested values. A line either starts with '#' thus is a preprocessor-line or is an include, so use "else". * scanner.c: Typo in comment. * invoke.texi: Document -ffree-line-length- and -ffree-line-length-none
updated patch: http://gcc.gnu.org/ml/fortran/2005-11/msg00551.html
updated patch: http://gcc.gnu.org/ml/fortran/2005-11/msg00612.html ACK by stevenb: http://gcc.gnu.org/ml/fortran/2005-11/msg00631.html
(In reply to comment #8) > updated patch: > > http://gcc.gnu.org/ml/fortran/2005-11/msg00612.html > > ACK by stevenb: > http://gcc.gnu.org/ml/fortran/2005-11/msg00631.html > And each a testcase for -ffree-line-length-none and -ffixed-line-length-none here: http://gcc.gnu.org/ml/fortran/2005-11/msg00676.html Please apply, thank you
Subject: Bug 21302 Author: kargl Date: Wed Nov 30 23:57:44 2005 New Revision: 107745 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107745 Log: 2005-11-30 Bernhard Fischer <rep.nop@aon.at> PR fortran/21302 * lang.opt: New options -ffree-line-length- and -ffree-line-length-none. * gfortran.h: Add free_line_length and add description of free_line_length and fixed_line_length. * options.c (gfc_init_options, gfc_handle_option): Initialize and set free_line_length and fixed_line_length. * scanner.c (load_line): Set free_line_length to 132 and fixed_line_length to 72 or user requested values. * scanner.c: Typo in comment. * invoke.texi: Document -ffree-line-length- and -ffree-line-length-none gfortran.dg/line_length_1.f: New test: gfortran.dg/line_length_2.f90: Ditto. Added: trunk/gcc/testsuite/gfortran.dg/line_length_1.f trunk/gcc/testsuite/gfortran.dg/line_length_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/invoke.texi trunk/gcc/fortran/lang.opt trunk/gcc/fortran/options.c trunk/gcc/fortran/scanner.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 21302 Author: kargl Date: Fri Dec 2 00:35:41 2005 New Revision: 107850 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107850 Log: PR fortran/21302 * lang.opt: New options -ffree-line-length- and -ffree-line-length-none. * gfortran.h: Add free_line_length and add description of free_line_length and fixed_line_length. * options.c (gfc_init_options, gfc_handle_option): Initialize and set free_line_length and fixed_line_length. * scanner.c (load_line): Set free_line_length to 132 and fixed_line_length to 72 or user requested values. * scanner.c: Typo in comment. * invoke.texi: Document -ffree-line-length- and -ffree-line-length-none PR fortran/21302 * gfortran.dg/line_length_1.f: New test. * gfortran.dg/line_length_2.f90: Ditto. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/line_length_1.f branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/line_length_2.f90 Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/gfortran.h branches/gcc-4_1-branch/gcc/fortran/invoke.texi branches/gcc-4_1-branch/gcc/fortran/lang.opt branches/gcc-4_1-branch/gcc/fortran/options.c branches/gcc-4_1-branch/gcc/fortran/scanner.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed.