1 /* Handling of compile-time options that influence the library.
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of the GNU Fortran 95 runtime library (libgfortran).
6 Libgfortran is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 In addition to the permissions in the GNU General Public License, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of this file into combinations with other programs,
14 and to distribute those combinations without any restriction coming
15 from the use of this file. (The General Public License restrictions
16 do apply in other respects; for example, they cover modification of
17 the file, and distribution when not linked into a combine
20 Libgfortran is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with libgfortran; see the file COPYING. If not, write to
27 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
28 Boston, MA 02110-1301, USA. */
32 #include "libgfortran.h"
35 /* Useful compile-time options will be stored in here. */
36 compile_options_t compile_options;
40 extern void set_std (GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4,
42 export_proto(set_std);
46 set_std (GFC_INTEGER_4 warn_std, GFC_INTEGER_4 allow_std,
47 GFC_INTEGER_4 pedantic, GFC_INTEGER_4 dump_core)
49 compile_options.pedantic = pedantic;
50 compile_options.warn_std = warn_std;
51 compile_options.allow_std = allow_std;
52 compile_options.dump_core = dump_core;
56 /* Default values for the compile-time options. Keep in sync with
57 gcc/fortran/options.c (gfc_init_options). */
59 init_compile_options (void)
61 compile_options.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
62 | GFC_STD_F2003 | GFC_STD_LEGACY;
63 compile_options.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
64 | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY;
65 compile_options.pedantic = 0;
66 compile_options.dump_core = 0;
69 /* Function called by the front-end to tell us the
70 default for unformatted data conversion. */
72 extern void set_convert (int);
73 export_proto (set_convert);
76 set_convert (int conv)
78 compile_options.convert = conv;
81 extern void set_record_marker (int);
82 export_proto (set_record_marker);
86 set_record_marker (int val)
92 compile_options.record_marker = sizeof (GFC_INTEGER_4);
96 compile_options.record_marker = sizeof (GFC_INTEGER_8);
100 runtime_error ("Invalid value for record marker");
105 extern void set_max_subrecord_length (int);
106 export_proto (set_max_subrecord_length);
108 void set_max_subrecord_length(int val)
110 if (val > GFC_MAX_SUBRECORD_LENGTH || val < 1)
112 runtime_error ("Invalid value for maximum subrecord length");
116 compile_options.max_subrecord_length = val;