Commit a67ec6ab by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR fortran/18452 (Fortran options induces warning for fortran that needs preprocessing)

	PR fortran/18452

	* gcc/fortran/lang-specs.h: Pass -lang-fortran to the preprocessor.

	* gcc/c.opt: Add a -lang-fortran option.
	* gcc/c-opts.c: Add a lang_fortran flag.
	(c_common_init_options): Handling the -lang-fortran option.
	(c_common_handle_option): Add a case for Fortran options in
	preprocessing. Remove cases for -ffixed-form and
	-ffixed-line-length. Add a case for -lang-fortran.

From-SVN: r106483
parent 553ff21c
2005-11-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/18452
* gcc/c.opt: Add a -lang-fortran option.
* gcc/c-opts.c: Add a lang_fortran flag.
(c_common_init_options): Handling the -lang-fortran option.
(c_common_handle_option): Add a case for Fortran options in
preprocessing. Remove cases for -ffixed-form and
-ffixed-line-length. Add a case for -lang-fortran.
2005-11-03 David Edelsohn <edelsohn@gnu.org> 2005-11-03 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c: Include params.h * config/rs6000/rs6000.c: Include params.h
......
...@@ -70,6 +70,9 @@ static bool deps_seen; ...@@ -70,6 +70,9 @@ static bool deps_seen;
/* If -v seen. */ /* If -v seen. */
static bool verbose; static bool verbose;
/* If -lang-fortran seen. */
static bool lang_fortran = false;
/* Dependency output file. */ /* Dependency output file. */
static const char *deps_file; static const char *deps_file;
...@@ -237,6 +240,15 @@ c_common_init_options (unsigned int argc, const char **argv) ...@@ -237,6 +240,15 @@ c_common_init_options (unsigned int argc, const char **argv)
result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX; result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX;
break; break;
} }
#ifdef CL_Fortran
for (i = 1; i < argc; i++)
if (! strcmp (argv[i], "-lang-fortran"))
{
result |= CL_Fortran;
break;
}
#endif
} }
return result; return result;
...@@ -258,6 +270,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -258,6 +270,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
default: default:
if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX)) if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX))
break; break;
#ifdef CL_Fortran
if (lang_fortran && (cl_options[code].flags & (CL_Fortran)))
break;
#endif
result = 0; result = 0;
break; break;
...@@ -651,13 +667,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -651,13 +667,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
cpp_opts->extended_identifiers = value; cpp_opts->extended_identifiers = value;
break; break;
case OPT_ffixed_form:
case OPT_ffixed_line_length_:
/* Fortran front end options ignored when preprocessing only. */
if (!flag_preprocess_only)
result = 0;
break;
case OPT_ffor_scope: case OPT_ffor_scope:
flag_new_for_scope = value; flag_new_for_scope = value;
break; break;
...@@ -833,6 +842,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -833,6 +842,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
cpp_opts->dollars_in_ident = false; cpp_opts->dollars_in_ident = false;
break; break;
case OPT_lang_fortran:
lang_fortran = true;
break;
case OPT_lang_objc: case OPT_lang_objc:
cpp_opts->objc = 1; cpp_opts->objc = 1;
break; break;
......
...@@ -781,6 +781,9 @@ C ObjC C++ ObjC++ Joined Separate ...@@ -781,6 +781,9 @@ C ObjC C++ ObjC++ Joined Separate
lang-asm lang-asm
C Undocumented C Undocumented
lang-fortran
C Undocumented
lang-objc lang-objc
C ObjC C++ ObjC++ Undocumented C ObjC C++ ObjC++ Undocumented
......
2005-11-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/18452
* lang-specs.h: Pass -lang-fortran to the preprocessor.
2005-11-02 Andrew Pinski <pinskia@physics.uc.edu> 2005-11-02 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/18157 PR fortran/18157
......
...@@ -11,7 +11,7 @@ This file is licensed under the GPL. */ ...@@ -11,7 +11,7 @@ This file is licensed under the GPL. */
{".fpp", "@f77-cpp-input", 0, 0, 0}, {".fpp", "@f77-cpp-input", 0, 0, 0},
{".FPP", "@f77-cpp-input", 0, 0, 0}, {".FPP", "@f77-cpp-input", 0, 0, 0},
{"@f77-cpp-input", {"@f77-cpp-input",
"cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ "cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\ %{E|M|MM:%(cpp_debug_options)}\
%{!M:%{!MM:%{!E: -o %|.f |\n\ %{!M:%{!MM:%{!E: -o %|.f |\n\
f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\ f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\
...@@ -19,7 +19,7 @@ This file is licensed under the GPL. */ ...@@ -19,7 +19,7 @@ This file is licensed under the GPL. */
{".F90", "@f95-cpp-input", 0, 0, 0}, {".F90", "@f95-cpp-input", 0, 0, 0},
{".F95", "@f95-cpp-input", 0, 0, 0}, {".F95", "@f95-cpp-input", 0, 0, 0},
{"@f95-cpp-input", {"@f95-cpp-input",
"cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ "cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\ %{E|M|MM:%(cpp_debug_options)}\
%{!M:%{!MM:%{!E: -o %|.f95 |\n\ %{!M:%{!MM:%{!E: -o %|.f95 |\n\
f951 %|.f95 %(cc1_options) %{J*} %{I*}\ f951 %|.f95 %(cc1_options) %{J*} %{I*}\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment