* opts.c (warning_disallowed_functions, warn_disallowed_functions,
warn_if_disallowed_function_p): Removed.
(common_handle_option): Don't handle OPT_Wdisallowed_function_list_.
* c-parser.c (c_parser_postfix_expression_after_primary): Don't call
warning_if_disallowed_function_p.
* flags.h (warn_if_disallowed_function_p,
warn_disallowed_functions): Removed.
* common.opt (Wdisallowed-function-list=): Removed.
* doc/invoke.texi (-Wdisallowed-function-list=): Removed.
* parser.c (cp_parser_postfix_expression): Don't call
warning_if_disallowed_function_p.
* gcc.dg/wdisallowed-functions-1.c: Removed.
* gcc.dg/wdisallowed-functions-2.c: Removed.
* gcc.dg/wdisallowed-functions-3.c: Removed.
* g++.dg/warn/Wdisallowed-functions-1.C: Removed.
* g++.dg/warn/Wdisallowed-functions-2.C: Removed.
* g++.dg/warn/Wdisallowed-functions-3.C: Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145198
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39554
+ * opts.c (warning_disallowed_functions, warn_disallowed_functions,
+ warn_if_disallowed_function_p): Removed.
+ (common_handle_option): Don't handle OPT_Wdisallowed_function_list_.
+ * c-parser.c (c_parser_postfix_expression_after_primary): Don't call
+ warning_if_disallowed_function_p.
+ * flags.h (warn_if_disallowed_function_p,
+ warn_disallowed_functions): Removed.
+ * common.opt (Wdisallowed-function-list=): Removed.
+ * doc/invoke.texi (-Wdisallowed-function-list=): Removed.
+
2009-03-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38723
"expected %<)%>");
expr.value = build_function_call (expr.value, exprlist);
expr.original_code = ERROR_MARK;
- if (warn_disallowed_functions)
- warn_if_disallowed_function_p (expr.value);
break;
case CPP_DOT:
/* Structure element reference. */
Common Var(warn_disabled_optimization) Warning
Warn when an optimization pass is disabled
-Wdisallowed-function-list=
-Common RejectNegative Joined Warning
-Warn on calls to these functions
-
Werror
Common Var(warnings_are_errors)
Treat all warnings as errors
+2009-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39554
+ * parser.c (cp_parser_postfix_expression): Don't call
+ warning_if_disallowed_function_p.
+
2009-03-27 Jan Hubicka <jh@suse.cz>
* except.c (choose_personality_routine): Set terminate_node to abort
koenig_p,
tf_warning_or_error);
- if (warn_disallowed_functions)
- warn_if_disallowed_function_p (postfix_expression);
-
/* The POSTFIX_EXPRESSION is certainly no longer an id. */
idk = CP_ID_KIND_NONE;
}
-Wchar-subscripts -Wclobbered -Wcomment @gol
-Wconversion -Wcoverage-mismatch -Wno-deprecated @gol
-Wno-deprecated-declarations -Wdisabled-optimization @gol
--Wdisallowed-function-list=@var{sym},@var{sym},@dots{} @gol
-Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels @gol
-Werror -Werror=* @gol
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
This option is implied by @option{-pedantic}, and can be disabled with
@option{-Wno-overlength-strings}.
-
-@item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
-@opindex Wdisallowed-function-list
-
-If any of @var{sym} is called, GCC will issue a warning. This can be useful
-in enforcing coding conventions that ban calls to certain functions, for
-example, @code{alloca}, @code{malloc}, etc.
@end table
@node Debugging Options
/* Compilation switch flag definitions for GCC.
Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
instrumentation. */
extern bool flag_instrument_functions_exclude_p (tree fndecl);
-/* Emit warning if the function call is disallowed under
- -Wdisallowed-function-list=... */
-extern void warn_if_disallowed_function_p (const_tree fncall);
-
-/* True, if the -Wdisallowed-function-list=... option has been specified. */
-extern bool warn_disallowed_functions;
-
/* True if the given mode has a NaN representation and the treatment of
NaN operands is important. Certain optimizations, such as folding
x * 0 into 0, are not correct for NaN operands, and are normally
static VEC(const_char_p,heap) *ignored_options;
-/* Function calls disallowed under -Wdisallowed-function-list=... */
-static VEC(char_p,heap) *warning_disallowed_functions;
-
-/* If -Wdisallowed-function-list=... */
-bool warn_disallowed_functions = false;
-
/* Input file names. */
const char **in_fnames;
unsigned num_in_fnames;
}
-/* Return whether this function call is disallowed. */
-void
-warn_if_disallowed_function_p (const_tree exp)
-{
- if (TREE_CODE (exp) == CALL_EXPR
- && VEC_length (char_p, warning_disallowed_functions) > 0)
- {
- int i;
- char *s;
- tree fndecl = get_callee_fndecl (exp);
- const char *fnname;
-
- if (fndecl == NULL)
- return;
-
- fnname = get_name (fndecl);
- if (fnname == NULL)
- return;
-
- for (i = 0; VEC_iterate (char_p, warning_disallowed_functions, i, s);
- ++i)
- {
- if (strcmp (fnname, s) == 0)
- {
- warning (OPT_Wdisallowed_function_list_,
- "disallowed call to %qs", fnname);
- break;
- }
- }
- }
-}
-
/* Decode and handle the vector of command line options. LANG_MASK
contains has a single bit set representing the current
language. */
set_Wextra (value);
break;
- case OPT_Wdisallowed_function_list_:
- warn_disallowed_functions = true;
- add_comma_separated_to_vector
- (&warning_disallowed_functions, arg);
- break;
-
case OPT_Werror_:
enable_warning_as_error (arg, value, lang_mask);
break;
+2009-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39554
+ * gcc.dg/wdisallowed-functions-1.c: Removed.
+ * gcc.dg/wdisallowed-functions-2.c: Removed.
+ * gcc.dg/wdisallowed-functions-3.c: Removed.
+ * g++.dg/warn/Wdisallowed-functions-1.C: Removed.
+ * g++.dg/warn/Wdisallowed-functions-2.C: Removed.
+ * g++.dg/warn/Wdisallowed-functions-3.C: Removed.
+
2009-03-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38723
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-Wdisallowed-function-list=foobar" } */
-
-int foobar (int i)
-{
- return (i * 5);
-}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-Wdisallowed-function-list=foo,foobar,bar,foobar" } */
-
-int foobar (int i)
-{
- return (i * 5);
-}
-
-int foobar1 (int i)
-{
- return foobar (i); /* { dg-warning "disallowed call to 'foobar'" } */
-}
+++ /dev/null
-// PR c++/39554
-// { dg-do compile }
-// { dg-options "-Wdisallowed-function-list=bar" }
-
-void
-foo (void (*p) (), void (*bar) ())
-{
- p ();
- bar ();
-}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-Wdisallowed-function-list=foobar" } */
-
-int foobar (int i)
-{
- return (i * 5);
-}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-Wdisallowed-function-list=foo,foobar,bar,foobar" } */
-
-int foobar (int i)
-{
- return (i * 5);
-}
-
-int foobar1 (int i)
-{
- return foobar (i); /* { dg-warning "disallowed call to 'foobar'" } */
-}
+++ /dev/null
-/* PR c++/39554 */
-/* { dg-do compile } */
-/* { dg-options "-Wdisallowed-function-list=bar" } */
-
-void
-foo (void (*p) (void), void (*bar) (void))
-{
- p ();
- bar ();
-}