aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Moses <brooks.moses@codesourcery.com>2006-11-15 03:52:03 +0000
committerBrooks Moses <brooks@gcc.gnu.org>2006-11-14 19:52:03 -0800
commit1dde868307b85e9be0f93c6e0483b4eb818ef3cf (patch)
tree48bf955c5a301ae0a43b653d35cd27e7c36b6821
parent4887aa7174404d3fa35104ffba53ad4dc613b474 (diff)
downloadgcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.zip
gcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.tar.gz
gcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.tar.bz2
gfortran.h (GFC_MAX_LINE): Remove constant definition.
* gfortran.h (GFC_MAX_LINE): Remove constant definition. (gfc_option_t): Clarify comments. * options.c: Set default line length limits to actual default values, rather than flag values. * scanner.c: Eliminate checking and handling of the fixed/free_line_length flag values. From-SVN: r118842
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/gfortran.h21
-rw-r--r--gcc/fortran/options.c4
-rw-r--r--gcc/fortran/scanner.c26
4 files changed, 28 insertions, 32 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9e1433c..709bc4b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,14 @@
2006-11-14 Brooks Moses <brooks.moses@codesourcery.com>
+ * gfortran.h (GFC_MAX_LINE): Remove constant definition.
+ (gfc_option_t): Clarify comments.
+ * options.c: Set default line length limits to actual default
+ values, rather than flag values.
+ * scanner.c: Eliminate checking and handling of the
+ fixed/free_line_length flag values.
+
+2006-11-14 Brooks Moses <brooks.moses@codesourcery.com>
+
* lang.opt: Remove -fno-backend option.
* gfortran.h (gfc_option_t): Remove flag_no_backend.
* options.c (gfc_init_options): Remove flag_no_backend.
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index a369d32..cf0dabf 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -55,8 +55,7 @@ char *alloca ();
/* Major control parameters. */
-#define GFC_MAX_SYMBOL_LEN 63
-#define GFC_MAX_LINE 132 /* Characters beyond this are not seen. */
+#define GFC_MAX_SYMBOL_LEN 63 /* Must be at least 63 for F2003. */
#define GFC_MAX_DIMENSIONS 7 /* Maximum dimensions in an array. */
#define GFC_LETTERS 26 /* Number of letters in the alphabet. */
@@ -1602,20 +1601,16 @@ typedef struct
{
char *module_dir;
gfc_source_form source_form;
- /* When fixed_line_length or free_line_length are 0, the whole line is used.
-
- Default is -1, the maximum line length mandated by the respective source
- form is used:
- for FORM_FREE GFC_MAX_LINE (132)
- else 72.
-
- If fixed_line_length or free_line_length is not 0 nor -1 then the user has
- requested a specific line-length.
+ /* Maximum line lengths in fixed- and free-form source, respectively.
+ When fixed_line_length or free_line_length are 0, the whole line is used,
+ regardless of length.
If the user requests a fixed_line_length <7 then gfc_init_options()
emits a fatal error. */
- int fixed_line_length; /* maximum line length in fixed-form. */
- int free_line_length; /* maximum line length in free-form. */
+ int fixed_line_length;
+ int free_line_length;
+ /* Maximum number of continuation lines in fixed- and free-form source,
+ respectively. */
int max_continue_fixed;
int max_continue_free;
int max_identifier_length;
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 3d870b8..6afcaa4 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -46,8 +46,8 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
gfc_source_file = NULL;
gfc_option.module_dir = NULL;
gfc_option.source_form = FORM_UNKNOWN;
- gfc_option.fixed_line_length = -1;
- gfc_option.free_line_length = -1;
+ gfc_option.fixed_line_length = 72;
+ gfc_option.free_line_length = 132;
gfc_option.max_continue_fixed = 19;
gfc_option.max_continue_free = 39;
gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN;
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index b054904..92ee366 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -956,33 +956,25 @@ load_line (FILE * input, char **pbuf, int *pbuflen)
int seen_printable = 0, seen_ampersand = 0;
char *buffer;
- /* Determine the maximum allowed line length.
- The default for free-form is GFC_MAX_LINE, for fixed-form or for
- unknown form it is 72. Refer to the documentation in gfc_option_t. */
+ /* Determine the maximum allowed line length. */
if (gfc_current_form == FORM_FREE)
- {
- if (gfc_option.free_line_length == -1)
- maxlen = GFC_MAX_LINE;
- else
- maxlen = gfc_option.free_line_length;
- }
+ maxlen = gfc_option.free_line_length;
else if (gfc_current_form == FORM_FIXED)
- {
- if (gfc_option.fixed_line_length == -1)
- maxlen = 72;
- else
- maxlen = gfc_option.fixed_line_length;
- }
+ maxlen = gfc_option.fixed_line_length;
else
maxlen = 72;
if (*pbuf == NULL)
{
- /* Allocate the line buffer, storing its length into buflen. */
+ /* Allocate the line buffer, storing its length into buflen.
+ Note that if maxlen==0, indicating that arbitrary-length lines
+ are allowed, the buffer will be reallocated if this length is
+ insufficient; since 132 characters is the length of a standard
+ free-form line, we use that as a starting guess. */
if (maxlen > 0)
buflen = maxlen;
else
- buflen = GFC_MAX_LINE;
+ buflen = 132;
*pbuf = gfc_getmem (buflen + 1);
}