This is the mail archive of the gcc-patches@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]

Re: unify handling of -Wreturn-type


Howdy,

Here is a second go at simplifying the handling of -Wreturn-type,
removing the declaration in cp-tree.h as Joseph S. Myers
suggested.  It bootstrapped on i686-pc-linux-gnu.

Matt

(for gcc/ChangeLog)

2001-02-21  Matt Kraai  <kraai@alumni.carnegiemellon.edu>

	* c-decl.c (c_decode_option): Remove decoding of -Wreturn-type.
	* toplev.c (W_options): Add -Wreturn-type.

(for gcc/cp/ChangeLog)

2001-02-21  Matt Kraai  <kraai@alumni.carnegiemellon.edu>

	* cp-tree.h: Remove declaration of warn_return_type.
	* decl2.c (cxx_decode_option): Remove decoding of -Wreturn-type.
	* lang-options.h: Remove -Wreturn-type.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.210
diff -c -3 -p -r1.210 c-decl.c
*** c-decl.c	2001/02/21 14:42:09	1.210
--- c-decl.c	2001/02/21 16:00:36
*************** c_decode_option (argc, argv)
*** 710,719 ****
      warn_parentheses = 1;
    else if (!strcmp (p, "-Wno-parentheses"))
      warn_parentheses = 0;
-   else if (!strcmp (p, "-Wreturn-type"))
-     warn_return_type = 1;
-   else if (!strcmp (p, "-Wno-return-type"))
-     warn_return_type = 0;
    else if (!strcmp (p, "-Wsequence-point"))
      warn_sequence_point = 1;
    else if (!strcmp (p, "-Wno-sequence-point"))
--- 710,715 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.426
diff -c -3 -p -r1.426 toplev.c
*** toplev.c	2001/02/21 14:42:18	1.426
--- toplev.c	2001/02/21 16:00:37
*************** lang_independent_options W_options[] =
*** 1474,1480 ****
    {"disabled-optimization", &warn_disabled_optimization, 1,
     "Warn when an optimization pass is disabled"},
    {"missing-noreturn", &warn_missing_noreturn, 1,
!    "Warn about functions which might be candidates for attribute noreturn"}
  };
  
  /* Output files for assembler code (real compiler output)
--- 1474,1482 ----
    {"disabled-optimization", &warn_disabled_optimization, 1,
     "Warn when an optimization pass is disabled"},
    {"missing-noreturn", &warn_missing_noreturn, 1,
!    "Warn about functions which might be candidates for attribute noreturn"},
!   {"return-type", &warn_return_type, 1,
!    "Warn about inconsistent return types"}
  };
  
  /* Output files for assembler code (real compiler output)
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.580
diff -c -3 -p -r1.580 cp-tree.h
*** cp-tree.h	2001/02/21 14:42:24	1.580
--- cp-tree.h	2001/02/21 16:00:38
*************** extern int warn_implicit;
*** 1013,1023 ****
  
  extern int warn_ctor_dtor_privacy;
  
- /* Nonzero means warn about function definitions that default the return type
-    or that use a null return and have a return-type other than void.  */
- 
- extern int warn_return_type;
- 
  /* Nonzero means warn about deprecated conversion from string constant to
     `char *'.  */
  
--- 1013,1018 ----
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.443
diff -c -3 -p -r1.443 decl2.c
*** decl2.c	2001/02/19 21:47:08	1.443
--- decl2.c	2001/02/21 16:00:39
*************** cxx_decode_option (argc, argv)
*** 669,676 ****
  	warn_implicit = setting;
        else if (!strcmp (p, "long-long"))
  	warn_long_long = setting;
-       else if (!strcmp (p, "return-type"))
- 	warn_return_type = setting;
        else if (!strcmp (p, "ctor-dtor-privacy"))
  	warn_ctor_dtor_privacy = setting;
        else if (!strcmp (p, "write-strings"))
--- 669,674 ----
Index: cp/lang-options.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lang-options.h,v
retrieving revision 1.37
diff -c -3 -p -r1.37 lang-options.h
*** lang-options.h	2001/01/05 19:12:19	1.37
--- lang-options.h	2001/02/21 16:00:39
*************** DEFINE_LANG_NAME ("C++")
*** 112,119 ****
    { "-fxref", "Emit cross referencing information" },
    { "-fno-xref", "" },
  
-   { "-Wreturn-type", "Warn about inconsistent return types" },
-   { "-Wno-return-type", "" },
    { "-Woverloaded-virtual", "Warn about overloaded virtual function names" },
    { "-Wno-overloaded-virtual", "" },
    { "-Wctor-dtor-privacy", "" },
--- 112,117 ----


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