summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-17 07:17:56 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-17 07:17:56 +0000
commitf003f5dcb67d4c25184a57afe661122d934109be (patch)
tree4109785fceb3bc788cf4f9ee1e8a0fc71649fdfb /gcc/c-family/c-opts.c
parentc1420b840682a8a9ccb2263d882c69c3c1e3db55 (diff)
downloadgcc-f003f5dcb67d4c25184a57afe661122d934109be.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r--gcc/c-family/c-opts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 2fa59dc9795..29121b5d474 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1,6 +1,6 @@
/* C/ObjC/C++ command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+ 2012 Free Software Foundation, Inc.
Contributed by Neil Booth.
This file is part of GCC.
@@ -374,6 +374,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warn_return_type = value;
warn_sequence_point = value; /* Was C only. */
warn_switch = value;
+ warn_sizeof_pointer_memaccess = value;
if (warn_strict_aliasing == -1)
set_Wstrict_aliasing (&global_options, value);
warn_address = value;