/* top.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Contributed by James Craig Burley.
This file is part of GNU Fortran.
/* Include files. */
-#include <ctype.h>
#include "proj.h"
#include "top.h"
#include "bad.h"
#include "target.h"
#include "where.h"
#if FFECOM_targetCURRENT == FFECOM_targetGCC
-#include "flags.j"
+#include "flags.h"
+#include "toplev.h"
#endif
/* Externals defined here. */
int flag_traditional; /* Shouldn't need this (C front end only)! */
-bool ffe_is_do_internal_checks_ = TRUE;
+bool ffe_is_do_internal_checks_ = FALSE;
bool ffe_is_90_ = FFETARGET_defaultIS_90;
bool ffe_is_automatic_ = FFETARGET_defaultIS_AUTOMATIC;
bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH;
-bool ffe_is_emulate_complex_ = TRUE;
+bool ffe_is_emulate_complex_ = FALSE;
bool ffe_is_underscoring_ = FFETARGET_defaultEXTERNAL_UNDERSCORED
|| FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
bool ffe_is_second_underscore_ = FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
bool ffe_is_f2c_ = FFETARGET_defaultIS_F2C;
bool ffe_is_f2c_library_ = FFETARGET_defaultIS_F2C_LIBRARY;
bool ffe_is_ffedebug_ = FALSE;
+bool ffe_is_flatten_arrays_ = FALSE;
bool ffe_is_free_form_ = FFETARGET_defaultIS_FREE_FORM;
bool ffe_is_globals_ = TRUE;
-bool ffe_is_ident_ = TRUE;
bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
bool ffe_is_mainprog_; /* TRUE if current prog unit known to be
main. */
+bool ffe_is_null_version_ = FALSE;
bool ffe_is_onetrip_ = FALSE;
bool ffe_is_silent_ = TRUE;
bool ffe_is_typeless_boz_ = FALSE;
{
char *p;
- for (p = s; isdigit (*p); ++p)
+ for (p = s; ISDIGIT (*p); ++p)
;
return (p != s) && (*p == '\0');
recognized and handled. */
int
-ffe_decode_option (char *opt)
+ffe_decode_option (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv;
{
+ char *opt = argv[0];
if (opt[0] != '-')
return 0;
if (opt[1] == 'f')
{
if (strcmp (&opt[2], "version") == 0)
- ffe_set_is_version (TRUE);
- else if (strcmp (&opt[2], "null-version") == 0)
- ; /* Someday generate program to print version
- info. */
- else if (strcmp (&opt[2], "set-g77-defaults") == 0)
{
- ffe_is_do_internal_checks_ = 0;
-#if BUILT_FOR_270 /* User must have applied patch (circa 2.7.2 and beyond). */
-#if 0
- flag_rerun_loop_opt = 1;
-#endif
- flag_move_all_movables = 1;
- flag_reduce_all_givs = 1;
- flag_argument_noalias = 2;
-#endif
+ ffe_set_is_version (TRUE);
+ ffe_set_is_do_internal_checks (TRUE);
}
- else if (strcmp (&opt[2], "ident") == 0)
- ffe_set_is_ident (TRUE);
- else if (strcmp (&opt[2], "no-ident") == 0)
- ffe_set_is_ident (FALSE);
+ else if (strcmp (&opt[2], "null-version") == 0)
+ ffe_set_is_null_version (TRUE);
else if (strcmp (&opt[2], "f66") == 0)
{
ffe_set_is_onetrip (TRUE);
ffe_set_is_f2c_library (TRUE);
else if (strcmp (&opt[2], "no-f2c-library") == 0)
ffe_set_is_f2c_library (FALSE);
+ else if (strcmp (&opt[2], "flatten-arrays") == 0)
+ ffe_set_is_flatten_arrays (TRUE);
+ else if (strcmp (&opt[2], "no-flatten-arrays") == 0)
+ ffe_set_is_flatten_arrays (FALSE);
else if (strcmp (&opt[2], "free-form") == 0)
ffe_set_is_free_form (TRUE);
else if (strcmp (&opt[2], "no-free-form") == 0)
warning ("%s no longer supported -- try -fvxt", opt);
else if (strcmp (&opt[2], "f90-not-vxt") == 0)
warning ("%s no longer supported -- try -fno-vxt -ff90", opt);
- else if (strcmp (&opt[2], "ugly") == 0)
- {
- warning ("%s is overloaded with meanings and likely to be removed;", opt);
- warning ("use only the specific -fugly-* options you need");
- ffe_set_is_ugly_args (TRUE);
- ffe_set_is_ugly_assign (TRUE);
- ffe_set_is_ugly_assumed (TRUE);
- ffe_set_is_ugly_comma (TRUE);
- ffe_set_is_ugly_complex (TRUE);
- ffe_set_is_ugly_init (TRUE);
- ffe_set_is_ugly_logint (TRUE);
- }
else if (strcmp (&opt[2], "no-ugly") == 0)
{
ffe_set_is_ugly_args (FALSE);
else if (strcmp (&opt[2], "no-zeros") == 0)
ffe_set_is_zeros (FALSE);
else if (strcmp (&opt[2], "debug-kludge") == 0)
- ffe_set_is_debug_kludge (TRUE);
+ warning ("%s disabled, use normal debugging flags", opt);
else if (strcmp (&opt[2], "no-debug-kludge") == 0)
- ffe_set_is_debug_kludge (FALSE);
+ warning ("%s disabled, use normal debugging flags", opt);
else if (strcmp (&opt[2], "onetrip") == 0)
ffe_set_is_onetrip (TRUE);
else if (strcmp (&opt[2], "no-onetrip") == 0)
ffe_set_is_globals (TRUE);
else if (strcmp (&opt[2], "no-globals") == 0)
ffe_set_is_globals (FALSE);
+ else if (strcmp (&opt[2], "fortran-bounds-check") == 0)
+ flag_bounds_check = TRUE;
+ else if (strcmp (&opt[2], "no-fortran-bounds-check") == 0)
+ flag_bounds_check = FALSE;
else if (strcmp (&opt[2], "typeless-boz") == 0)
ffe_set_is_typeless_boz (TRUE);
else if (strcmp (&opt[2], "no-typeless-boz") == 0)
warning about not using it without also specifying -O. */
if (warn_uninitialized != 1)
warn_uninitialized = 2;
- warn_unused = 1;
+ set_Wunused (1);
}
else
return 0;