File increase-maxline.patch of Package ftnchek
Increase maximum possible line length of input files from 132 to 10000,
which is mandated by Fortran2023.
Let the user decide which limit is the right one.
--- ftnchek-4beta_r132/ftnchek.h.orig 2014-04-11 12:50:33.573612616 +0200
+++ ftnchek-4beta_r132/ftnchek.h 2015-01-28 14:23:12.841746776 +0100
@@ -600,7 +600,7 @@ PROTO(VOID exit,(int));
#ifndef MAXLINE
-#define MAXLINE 132 /* Maximum input line length. Ignores past this. */
+#define MAXLINE 10000 /* Maximum input line length. Ignores past this. */
#endif
#ifndef MAXIDSIZE
#define MAXIDSIZE 64 /* Longest identifier allowed, 1+limit in 2003 */
@@ -817,10 +817,10 @@ typedef unsigned long LINENO_t;
typedef unsigned COLNO_t;
-#define NO_COL_NUM ((COLNO_t)999)/* Impossible column number to suppress
+#define NO_COL_NUM ((COLNO_t)MAXLINE+2)/* Impossible column number to suppress
* printing in error messages
*/
-#define GLOBAL_NO_COL_NUM ((LINENO_t)998)/* Ditto for global-level warnings */
+#define GLOBAL_NO_COL_NUM ((LINENO_t)MAXLINE+1)/* Ditto for global-level warnings */
#define NO_LINE_NUM ((LINENO_t)0)/* Ditto for line number to suppress flushing
* of line if error not in local context
--- ftnchek-4beta_r132/advance.c.orig 2015-01-28 14:34:26.524939571 +0100
+++ ftnchek-4beta_r132/advance.c 2015-01-28 14:35:03.604674842 +0100
@@ -219,7 +219,7 @@ init_scan(VOID) /* Starts reading a fi
/* Set max line length according to source form */
if( free_form ) {
- max_stmt_col = (COLNO_t)132; /* not adjustable */
+ max_stmt_col = (COLNO_t)MAX(132,fixed_max_stmt_col); /* may be changed by -column */
std_max_stmt_col = (COLNO_t)132;
}
else {
--- ftnchek-4beta_r132/makehtml.c.orig 2015-01-28 14:42:04.341673582 +0100
+++ ftnchek-4beta_r132/makehtml.c 2015-01-28 14:43:03.645249642 +0100
@@ -341,8 +341,8 @@ get_comments(
int buffcount = 0;
int row_hdr = 0;
int len;
- int min_leader = 132;
- char leader_srch[133];
+ int min_leader = MAXLINE;
+ char leader_srch[MAXLINE+1];
int more_than_blank_lines = 0;
/* Pointers into source buffer */
@@ -536,7 +536,7 @@ get_comments(
/* Clear the buffer and reset important counters and vars */
buffcount = 0;
more_than_blank_lines = 0;
- min_leader = 132;
+ min_leader = MAXLINE;
if ( buffer ) free( buffer );
buffer = pbuf = NULL;
mkhtml_bookmark = endComments; /* save a bookmark for next search */
--- ftnchek-4beta_r132/ftnchek.man.orig 2015-01-28 23:00:17.395433747 +0100
+++ ftnchek-4beta_r132/ftnchek.man 2015-01-28 23:03:13.582176347 +0100
@@ -356,7 +356,7 @@
.TP
.BI \-columns= num
Set maximum line length to \fInum\fP columns. (Beyond
-this is ignored.) Turn-on = max = 132. Default = 72.
+this is ignored.) Turn-on = max = 10000. Default = 72.
.TP
.BI \-common= list
Set degree of strictness in checking COMMON blocks.
@@ -1114,7 +1114,7 @@
If this setting is used when the \fB\-f77=long\-line\fP option is in effect, a
warning will be given for any lines in which characters past column 72
are processed.
-Turn-on = max = 132. Default = 72.
+Turn-on = max = 10000. Default = 72.
.PP
This setting does not suppress warnings about the presence of
characters beyond column 72.
@@ -1124,10 +1124,6 @@
the columns setting at the default value and use the
\fB\-pretty=no\-long\-line\fP flag.
.PP
-This setting has no effect when processing a source file in free
-format. The free-form statement line length limit of 132 columns cannot be
-changed in \fBftnchek\fP.
-.PP
See also: \fB\-f77\fP, \fB\-pretty\fP.
.RE
@@ -1661,9 +1657,7 @@
\fBlong\-line\fP:
Although the Fortran 90 Standard allows lines longer than 72
characters in free source form, this restriction still applies to fixed
-source form. In free source form the line length limit is 132 characters,
-and unlike fixed form, \fBftnchek\fP does not allow this limit to
-be increased.
+source form. In free source form the line length limit is 132 characters.
.TP
\fBmixed\-expr\fP:
This is the same as for \fB\-f77\fP except for expressions mixing