summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.h
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-12 18:23:03 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-12 18:23:03 +0000
commit57f872a2a1689ced0b7340178e6984393d07662e (patch)
tree53a2b873d7fe4f0c44a653a6e7c37c843b92ade2 /gcc/c-family/c-common.h
parent25d34a34470da2747013743e6a962f023d7a5868 (diff)
downloadgcc-57f872a2a1689ced0b7340178e6984393d07662e.tar.gz
PR c/54381
* c-common.h (sizeof_pointer_memaccess_warning): Adjust prototype. * c-common.c (sizeof_pointer_memaccess_warning): Take array of 3 locs and array of 3 trees instead of just single loc and single sizeof_arg tree. Handle __builtin___*_chk builtins too, and also stpncpy, bcopy, bcmp, bzero, snprintf and vsnprintf builtins. For *cmp* builtins that take two sources strings report warnings about first and second source, not about destination and source. * c-parser.c (struct c_tree_loc_pair): Removed. (c_parser_expr_list): Remove struct c_tree_loc_pair * argument, add location_t * and tree * arguments, fill in array of 3 sizeof_arg trees and corresponding locs. (c_parser_attributes, c_parser_objc_keywordexpr): Adjust c_parser_expr_list callers. (c_parser_postfix_expression_after_primary): Likewise. Pass array of 3 sizeof_arg trees and locs (corresponding to first 3 arguments) to sizeof_pointer_memaccess_warning. * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg trees and locs (corresponding to first 3 arguments) to sizeof_pointer_memaccess_warning. * c-c++-common/Wsizeof-pointer-memaccess1.c: New test. * c-c++-common/Wsizeof-pointer-memaccess2.c: New test. * gcc.dg/Wsizeof-pointer-memaccess1.c: New test. * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Test also stpncpy. Adjust expected wording of warnings for *cmp* builtins. * g++.dg/torture/Wsizeof-pointer-memaccess1.C: Likewise. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192406 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-common.h')
-rw-r--r--gcc/c-family/c-common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 66d90a34570..94449a5f3f3 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -769,8 +769,8 @@ extern tree fix_string_type (tree);
extern void constant_expression_warning (tree);
extern void constant_expression_error (tree);
extern bool strict_aliasing_warning (tree, tree, tree);
-extern void sizeof_pointer_memaccess_warning (location_t, tree,
- VEC(tree, gc) *, tree,
+extern void sizeof_pointer_memaccess_warning (location_t *, tree,
+ VEC(tree, gc) *, tree *,
bool (*) (tree, tree));
extern void warnings_for_convert_and_check (tree, tree, tree);
extern tree convert_and_check (tree, tree);