diff options
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r-- | gcc/fortran/options.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 8ead48f..e3879f0 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -1,5 +1,5 @@ /* Parse and display command line options. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -20,7 +20,6 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include "config.h" #include "system.h" #include "coretypes.h" @@ -31,7 +30,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "options.h" #include "params.h" #include "tree-inline.h" - #include "gfortran.h" #include "target.h" @@ -94,8 +92,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.fpe = 0; - /* Argument pointers cannot point to anything - but their argument. */ + /* Argument pointers cannot point to anything but their argument. */ flag_argument_noalias = 3; flag_errno_math = 0; @@ -112,7 +109,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.fshort_enums = targetm.default_short_enums (); /* Increase MAX_ALIASED_VOPS to account for different characteristics - of fortran regarding VOPs. */ + of Fortran regarding VOPs. */ MAX_ALIASED_VOPS = 50; return CL_Fortran; @@ -125,7 +122,6 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, static gfc_source_form form_from_filename (const char *filename) { - static const struct { const char *extension; @@ -223,6 +219,7 @@ gfc_post_options (const char **pfilename) i = strlen (canon_source_file); while (i > 0 && !IS_DIR_SEPARATOR (canon_source_file[i])) i--; + if (i != 0) { source_path = alloca (i + 1); @@ -260,8 +257,7 @@ gfc_post_options (const char **pfilename) gfc_warning_now ("'-fd-lines-as-comments' has no effect " "in free form"); else if (gfc_option.flag_d_lines == 1) - gfc_warning_now ("'-fd-lines-as-code' has no effect " - "in free form"); + gfc_warning_now ("'-fd-lines-as-code' has no effect in free form"); } flag_inline_trees = 1; @@ -304,7 +300,6 @@ gfc_post_options (const char **pfilename) static void set_Wall (void) { - gfc_option.warn_aliasing = 1; gfc_option.warn_ampersand = 1; gfc_option.warn_line_truncation = 1; @@ -350,12 +345,13 @@ gfc_handle_module_path_options (const char *arg) gfc_add_include_path (gfc_option.module_dir, true); } + static void gfc_handle_fpe_trap_option (const char *arg) { int result, pos = 0, n; static const char * const exception[] = { "invalid", "denormal", "zero", - "overflow", "underflow", + "overflow", "underflow", "precision", NULL }; static const int opt_exception[] = { GFC_FPE_INVALID, GFC_FPE_DENORMAL, GFC_FPE_ZERO, GFC_FPE_OVERFLOW, @@ -366,8 +362,10 @@ gfc_handle_fpe_trap_option (const char *arg) { while (*arg == ',') arg++; + while (arg[pos] && arg[pos] != ',') pos++; + result = 0; for (n = 0; exception[n] != NULL; n++) { @@ -380,13 +378,15 @@ gfc_handle_fpe_trap_option (const char *arg) break; } } - if (! result) + if (!result) gfc_fatal_error ("Argument to -ffpe-trap is not valid: %s", arg); } } + /* Handle command-line options. Returns 0 if unrecognized, 1 if recognized and handled. */ + int gfc_handle_option (size_t scode, const char *arg, int value) { @@ -665,7 +665,8 @@ gfc_handle_option (size_t scode, const char *arg, int value) case OPT_fmax_subrecord_length_: if (value > MAX_SUBRECORD_LENGTH) - gfc_fatal_error ("Maximum subrecord length cannot exceed %d", MAX_SUBRECORD_LENGTH); + gfc_fatal_error ("Maximum subrecord length cannot exceed %d", + MAX_SUBRECORD_LENGTH); gfc_option.max_subrecord_length = value; } |