Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2014 02:36:06 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261178 - in head/contrib/gcc: . cp doc
Message-ID:  <201401260236.s0Q2a61Q093880@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jan 26 02:36:06 2014
New Revision: 261178
URL: http://svnweb.freebsd.org/changeset/base/261178

Log:
  gcc: Add support for -Wmissing-prototypes in C++
  
  Support for warnings about missing prototypes in C++ was added by Apple
  GCC (Radar 6261539).  Most of the code crept into r260311 so it felt
  natural to make use of it.
  
  Obtained from:	Apple GCC - 5646
  MFC after:	5 days

Modified:
  head/contrib/gcc/c.opt
  head/contrib/gcc/cp/decl.c
  head/contrib/gcc/doc/invoke.texi

Modified: head/contrib/gcc/c.opt
==============================================================================
--- head/contrib/gcc/c.opt	Sun Jan 26 02:23:16 2014	(r261177)
+++ head/contrib/gcc/c.opt	Sun Jan 26 02:36:06 2014	(r261178)
@@ -280,9 +280,11 @@ Wmissing-include-dirs
 C ObjC C++ ObjC++
 Warn about user-specified include directories that do not exist
 
+; APPLE LOCAL begin warn missing prototype 6261539
 Wmissing-prototypes
-C ObjC Var(warn_missing_prototypes)
+C ObjC C++ ObjC++ Var(warn_missing_prototypes)
 Warn about global functions without prototypes
+; APPLE LOCAL end warn missing prototype 6261539
 
 ; APPLE LOCAL begin -Wmost
 Wmost

Modified: head/contrib/gcc/cp/decl.c
==============================================================================
--- head/contrib/gcc/cp/decl.c	Sun Jan 26 02:23:16 2014	(r261177)
+++ head/contrib/gcc/cp/decl.c	Sun Jan 26 02:36:06 2014	(r261178)
@@ -11486,6 +11486,10 @@ start_function (cp_decl_specifier_seq *d
     gcc_assert (same_type_p (TREE_TYPE (TREE_TYPE (decl1)),
 			     integer_type_node));
 
+  /* APPLE LOCAL begin warn missing prototype 6261539 */
+  check_missing_prototype (decl1);
+  /* APPLE LOCAL end warn missing prototype 6261539 */
+
   start_preparsed_function (decl1, attrs, /*flags=*/SF_DEFAULT);
 
   return 1;

Modified: head/contrib/gcc/doc/invoke.texi
==============================================================================
--- head/contrib/gcc/doc/invoke.texi	Sun Jan 26 02:23:16 2014	(r261177)
+++ head/contrib/gcc/doc/invoke.texi	Sun Jan 26 02:36:06 2014	(r261178)
@@ -225,6 +225,8 @@ in the following sections.
 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
 -Wmissing-noreturn @gol
+@c APPLE LOCAL warn missing prototype 6261539
+-Wmissing-prototypes @gol
 @c APPLE LOCAL -Wmost
 -Wmost (APPLE ONLY) @gol
 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
@@ -245,7 +247,8 @@ in the following sections.
 
 @item C-only Warning Options
 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
--Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
+@c APPLE LOCAL warn missing prototype 6261539
+-Wnested-externs  -Wold-style-definition @gol
 -Wstrict-prototypes  -Wtraditional @gol
 -Wdeclaration-after-statement -Wpointer-sign}
 
@@ -3052,7 +3055,8 @@ types.)
 Warn if an old-style function definition is used.  A warning is given
 even if there is a previous prototype.
 
-@item -Wmissing-prototypes @r{(C only)}
+@c APPLE LOCAL warn missing prototype 6261539
+@item -Wmissing-prototypes
 @opindex Wmissing-prototypes
 Warn if a global function is defined without a previous prototype
 declaration.  This warning is issued even if the definition itself



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401260236.s0Q2a61Q093880>