invoke.texi (-Wsizeof-pointer-memaccess): Document.
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 Aug 2012 07:17:56 +0000 (09:17 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 17 Aug 2012 07:17:56 +0000 (09:17 +0200)
commit1a4049e7c504bedf3f485fd94a26902959a4ce2a
tree4109785fceb3bc788cf4f9ee1e8a0fc71649fdfb
parent138f5acd18aafd07cd4a034cb8e879dd0621544b
invoke.texi (-Wsizeof-pointer-memaccess): Document.

* doc/invoke.texi (-Wsizeof-pointer-memaccess): Document.
c/
* c-tree.h (c_last_sizeof_arg): Declare.
* c-parser.c (struct c_tree_loc_pair): New type.
(c_parser_expr_list): Add sizeof_arg argument.  Fill it in if
non-NULL.
(c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
(c_parser_postfix_expression_after_primary): Likewise.  Call
sizeof_pointer_memaccess_warning if needed.
(sizeof_ptr_memacc_comptypes): New function.
* c-typeck.c (c_last_sizeof_arg): New global variable.
(c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
cp/
* cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
c-family/
* c-common.c (sizeof_pointer_memaccess_warning): New function.
* c.opt (-Wsizeof-pointer-memaccess): Add new option.
* c-opts.c (c_common_handle_option): Enable it for -Wall.
* c-common.h (sizeof_pointer_memaccess_warning): Add prototype.
* c-common.def (SIZEOF_EXPR): Moved here from cp-tree.def.
fortran/
* array.c (gfc_match_array_ref): Fix up memset arguments.
testsuite/
* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: New test.

From-SVN: r190467
18 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.def
gcc/c-family/c-common.h
gcc/c-family/c-opts.c
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.def
gcc/doc/invoke.texi
gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c [new file with mode: 0644]