[PATCH]: New warning option -Walloca

Raksit Ashok raksit.ashok@gmail.com
Mon Sep 17 22:16:00 GMT 2007


On 8/30/07, Dave Korn <dave.korn@artimi.com> wrote:
>   It seems a bit highly specialised to me... a generic
> "-Wdisallowed=alloca,foo,bar,..." option would be nicer, if you felt like
> extending it.

Following your advice, Dave, I have implemented a more general
warning: -Wdisallowed-function-list=foo,bar,alloca,... : emit warning
on calls to these functions.

OK for mainline?

Thanks,
Raksit

--------

gcc/ChangeLog

2007-09-17  Raksit Ashok <raksit.ashok@gmail.com>

	* doc/invoke.texi (Option Summary): Mention new option
	-Wdisallowed-function-list=...
	(Warning Options): Document -Wdisallowed-function-list=...
	* common.opt (Wdisallowed-function-list=): New flag.
	* flags.h (warn_disallowed_functions): External definition of new
	boolean warning flag.
	(warn_disallowed_function_p): Declare new function.
	* opts.c (warning_disallowed_functions): New static variable.
	(warn_disallowed_functions): New boolean warning flag.
	(warn_disallowed_function_p): New function.
	(add_comma_separated_to_vector): Rename
	add_instrument_functions_exclude_list to this.
	(common_handle_option): Handle new option. Rename calls to
	add_instrument_functions_exclude_list into calls to
	add_comma_separated_to_vector.
	* c-parser.c (c_parser_postfix_expression_after_primary): New warning
	based on flag warn_alloca.


gcc/cp/ChangeLog

2007-09-17  Raksit Ashok <raksit.ashok@gmail.com>

	* parser.c (cp_parser_postfix_expression): New warning based on flag
	warn_disallowed_functions.


gcc/testsuite/ChangeLog

2007-09-17  Raksit Ashok <raksit.ashok@gmail.com>

	* gcc.dg/wdisallowed-functions-1.c: New test.
	* gcc.dg/wdisallowed-functions-2.c: New test.
	* g++.dg/warn/Wdisallowed-functions-1.C: New test.
	* g++.dg/warn/Wdisallowed-functions-2.C: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wdisallowed.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070917/c2db73ad/attachment.txt>


More information about the Gcc-patches mailing list