/* Parse and display command line options.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
gfc_option.flag_init_character = GFC_INIT_CHARACTER_OFF;
gfc_option.flag_init_character_value = (char)0;
gfc_option.flag_align_commons = 1;
+ gfc_option.flag_protect_parens = 1;
gfc_option.fpe = 0;
gfc_option.rtcheck = 0;
-
- /* Argument pointers cannot point to anything but their argument. */
- flag_argument_noalias = 3;
+ gfc_option.coarray = GFC_FCOARRAY_NONE;
flag_errno_math = 0;
warn_unused = setting;
warn_return_type = setting;
warn_switch = setting;
-
- /* We save the value of warn_uninitialized, since if they put
- -Wuninitialized on the command line, we need to generate a
- warning about not using it without also specifying -O. */
- if (setting == 0)
- warn_uninitialized = 0;
- else if (warn_uninitialized != 1)
- warn_uninitialized = 2;
+ warn_uninitialized = setting;
}
static void
+gfc_handle_coarray_option (const char *arg)
+{
+ if (strcmp (arg, "none") == 0)
+ gfc_option.coarray = GFC_FCOARRAY_NONE;
+ else if (strcmp (arg, "single") == 0)
+ gfc_option.coarray = GFC_FCOARRAY_SINGLE;
+ else
+ gfc_fatal_error ("Argument to -fcoarray is not valid: %s", arg);
+}
+
+
+static void
gfc_handle_runtime_check_option (const char *arg)
{
int result, pos = 0, n;
static const char * const optname[] = { "all", "bounds", "array-temps",
- "recursion", "do", "pointer", NULL };
+ "recursion", "do", "pointer",
+ "mem", NULL };
static const int optmask[] = { GFC_RTCHECK_ALL, GFC_RTCHECK_BOUNDS,
GFC_RTCHECK_ARRAY_TEMPS,
GFC_RTCHECK_RECURSION, GFC_RTCHECK_DO,
- GFC_RTCHECK_POINTER,
+ GFC_RTCHECK_POINTER, GFC_RTCHECK_MEM,
0 };
while (*arg)
recognized and handled. */
int
-gfc_handle_option (size_t scode, const char *arg, int value)
+gfc_handle_option (size_t scode, const char *arg, int value,
+ int kind ATTRIBUTE_UNUSED)
{
int result = 1;
enum opt_code code = (enum opt_code) scode;
gfc_option.flag_align_commons = value;
break;
+ case OPT_fprotect_parens:
+ gfc_option.flag_protect_parens = value;
+ break;
+
case OPT_fcheck_:
gfc_handle_runtime_check_option (arg);
break;
+ case OPT_fcoarray_:
+ gfc_handle_coarray_option (arg);
+ break;
}
return result;