This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] gfortran options and cc1 warnings


New version of the patch attached (this time), to answer Joseph's remark. Original questions still apply, including:

What should "gfortran -fdollar-ok a.f b.c" do, if -fdollar-ok if a fortran-only option?

FX
2005-10-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

	PR fortran/18452
	* lang.opt: Add comments about adding Fortran options.


2005-10-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

	PR fortran/18452
	* gcc/c.opt: Add all Fortran options that can be passed to
	the preprocessor.
	* gcc/c-opts.c: Add cases for all Fortran options that can be
	passed to the preprocessor.

Index: gcc/fortran/lang.opt
===================================================================
--- gcc/fortran/lang.opt	(revision 106019)
+++ gcc/fortran/lang.opt	(working copy)
@@ -22,6 +22,14 @@
 
 ; Please try to keep this file in ASCII collating order.
 
+; To add a new Fortran option, you need to do the following:
+;    -- add the option in the list below
+;    -- get it handled by the Fortran front-end in options.c
+;    -- add the option in the c.opt file if the option will be passed to
+;       the preprocessor
+;    -- add it to the list of Fortran options in c_common_handle_option()
+;       in file c-opts.c
+
 Language
 Fortran
 
Index: gcc/c.opt
===================================================================
--- gcc/c.opt	(revision 106019)
+++ gcc/c.opt	(working copy)
@@ -231,6 +231,9 @@
 C ObjC Var(warn_implicit_int)
 Warn when a declaration does not specify a type
 
+Wimplicit-interface
+C Undocumented
+
 Wimport
 C ObjC C++ ObjC++
 Deprecated.  This switch has no effect
@@ -247,6 +250,9 @@
 C ObjC C++ ObjC++
 Warn about PCH files that are found but not used
 
+Wline-truncation
+C Undocumented
+
 Wlong-long
 C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
 Do not warn about using \"long long\" when -pedantic
@@ -299,6 +305,9 @@
 C ObjC Var(warn_nonnull)
 Warn about NULL being passed to argument slots marked as requiring non-NULL
 
+Wnonstd-intrinsics
+C Undocumented
+
 Wnormalized=
 C ObjC C++ ObjC++ Joined
 -Wnormalized=<id|nfc|nfkc>	Warn about non-normalised Unicode strings
@@ -379,6 +388,9 @@
 ObjC ObjC++ Var(warn_strict_selector_match)
 Warn if type signatures of candidate methods do not match exactly
 
+Wsurprising
+C Undocumented
+
 Wsynth
 C++ ObjC++ Var(warn_synth)
 Warn when synthesis behavior differs from Cfront
@@ -403,10 +415,16 @@
 C ObjC C++ ObjC++
 Warn if an undefined macro is used in an #if directive
 
+Wunderflow
+C Undocumented
+
 Wunknown-pragmas
 C ObjC C++ ObjC++
 Warn about unrecognized pragmas
 
+Wunused-labels
+C Undocumented
+
 Wunused-macros
 C ObjC C++ ObjC++
 Warn about macros defined in the main file that are not used
@@ -446,6 +464,12 @@
 C ObjC C++ ObjC++
 Recognize the \"asm\" keyword
 
+fautomatic
+C Undocumented
+
+fbackslash
+C Undocumented
+
 fbuiltin
 C ObjC C++ ObjC++
 Recognize built-in functions
@@ -473,14 +497,38 @@
 ObjC ObjC++ Joined
 -fconst-string-class=<name>	Use class <name> for constant strings
 
+fcray-pointer
+C Undocumented
+
+fdefault-double-8
+C Undocumented
+
 fdefault-inline
 C++ ObjC++
 Inline member functions by default
 
+fdefault-integer-8
+C Undocumented
+
+fdefault-real-8
+C Undocumented
+
+fd-lines-as-code
+C Undocumented
+
+fd-lines-as-comments
+C Undocumented
+
 fdollars-in-identifiers
 C ObjC C++ ObjC++
 Permit '$' as an identifier character
 
+fdollar-ok
+C Undocumented
+
+fdump-parse-tree
+C Undocumented
+
 felide-constructors
 C++ ObjC++
 
@@ -507,16 +555,28 @@
 fexternal-templates
 C++ ObjC++
 
+ff2c
+C Undocumented
+
 ffixed-form
-C ObjC
+C Undocumented
 
+ffixed-line-length-none
+C Undocumented
+
 ffixed-line-length-
-C ObjC Joined
+C Undocumented
 
 ffor-scope
 C++ ObjC++
 Scope of for-init-statement variables is local to the loop
 
+ffpe-trap=
+C Undocumented
+
+ffree-form
+C Undocumented
+
 ffreestanding
 C ObjC
 Do not assume that standard C libraries and \"main\" exist
@@ -554,6 +614,9 @@
 C++ ObjC++
 Emit implicit instantiations of inline templates
 
+fimplicit-none
+C Undocumented
+
 fimplicit-templates
 C++ ObjC++
 Emit implicit instantiations of templates
@@ -565,6 +628,15 @@
 flabels-ok
 C++ ObjC++
 
+fmax-identifier-length=
+C Undocumented
+
+fmax-stack-var-size=
+C Undocumented
+
+fmodule-private
+C Undocumented
+
 fms-extensions
 C ObjC C++ ObjC++
 Don't warn about uses of Microsoft extensions
@@ -583,6 +655,9 @@
 ObjC ObjC++
 Assume that receivers of Objective-C messages may be nil
 
+fno-backend
+C Undocumented
+
 fnonansi-builtins
 C++ ObjC++
 
@@ -622,6 +697,9 @@
 C++ ObjC++
 Enable optional diagnostics
 
+fpack-derived
+C Undocumented
+
 fpch-deps
 C ObjC C++ ObjC++
 
@@ -637,6 +715,9 @@
 C ObjC C++ ObjC++
 Treat the input file as already preprocessed
 
+frepack-arrays
+C Undocumented
+
 freplace-objc-classes
 ObjC ObjC++
 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
@@ -649,6 +730,9 @@
 C++ ObjC++
 Generate run time type descriptor information
 
+fsecond-underscore
+C Undocumented
+
 fshort-double
 C ObjC C++ ObjC++
 Use the same size for double as for float
@@ -694,6 +778,9 @@
 C++ ObjC++
 -fno-threadsafe-statics	Do not generate thread-safe code for initializing local statics
 
+funderscoring
+C Undocumented
+
 funsigned-bitfields
 C ObjC C++ ObjC++
 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
@@ -812,6 +899,9 @@
 C ObjC C++ ObjC++
 Print a checksum of the executable for PCH validity checking, and stop
 
+qkind=
+C Undocumented
+
 remap
 C ObjC C++ ObjC++
 Remap file names when including files
@@ -832,6 +922,15 @@
 C ObjC
 Deprecated in favor of -std=c99
 
+std=f95
+C Undocumented
+
+std=f2003
+C Undocumented
+
+std=gnu
+C Undocumented
+
 std=gnu++98
 C++ ObjC++
 Conform to the ISO 1998 C++ standard with GNU extensions
@@ -848,6 +947,9 @@
 C ObjC
 Deprecated in favor of -std=gnu99
 
+std=legacy
+C Undocumented
+
 std=iso9899:1990
 C ObjC
 Conform to the ISO 1990 C standard
Index: gcc/c-opts.c
===================================================================
--- gcc/c-opts.c	(revision 106019)
+++ gcc/c-opts.c	(working copy)
@@ -651,9 +651,45 @@
       cpp_opts->extended_identifiers = value;
       break;
 
+    case OPT_Wimplicit_interface:
+    case OPT_Wline_truncation:
+    case OPT_Wnonstd_intrinsics:
+    case OPT_Wsurprising:
+    case OPT_Wunderflow:
+    case OPT_Wunused_labels:
+    case OPT_fautomatic:
+    case OPT_fbackslash:
+    case OPT_fdefault_double_8:
+    case OPT_fdefault_integer_8:
+    case OPT_fdefault_real_8:
+    case OPT_fd_lines_as_code:
+    case OPT_fd_lines_as_comments:
+    case OPT_fdollar_ok:
+    case OPT_fdump_parse_tree:
+    case OPT_ff2c:
     case OPT_ffixed_form:
+    case OPT_ffree_form:
+    case OPT_funderscoring:
+    case OPT_fcray_pointer:
+    case OPT_fsecond_underscore:
+    case OPT_fimplicit_none:
+    case OPT_ffixed_line_length_none:
     case OPT_ffixed_line_length_:
-      /* Fortran front end options ignored when preprocessing only.  */
+    case OPT_fmax_identifier_length_:
+    case OPT_fmax_stack_var_size_:
+    case OPT_fmodule_private:
+    case OPT_fno_backend:
+    case OPT_fpack_derived:
+    case OPT_frepack_arrays:
+    case OPT_qkind_:
+    case OPT_ffpe_trap_:
+    case OPT_std_f95:
+    case OPT_std_f2003:
+    case OPT_std_gnu:
+    case OPT_std_legacy:
+      /* Fortran front end options ignored when preprocessing only.
+         This list is to be kept in sync with the list of options in
+	 fortran/lang.opt with C as language.  */
       if (!flag_preprocess_only)
         result = 0;
       break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]