aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.h
diff options
context:
space:
mode:
authorSimon Baldwin <simonb@google.com>2008-05-01 19:03:32 +0000
committerSimon Baldwin <simonb@gcc.gnu.org>2008-05-01 19:03:32 +0000
commitca873b0e5aafd6c0fce9e00719671c6aa25c708b (patch)
tree9ed540dc4bc280eaffa691609aa5d92b79a62090 /gcc/c-common.h
parent99c25ac11ec95adec4139b7aa79a4741a52111be (diff)
downloadgcc-ca873b0e5aafd6c0fce9e00719671c6aa25c708b.zip
gcc-ca873b0e5aafd6c0fce9e00719671c6aa25c708b.tar.gz
gcc-ca873b0e5aafd6c0fce9e00719671c6aa25c708b.tar.bz2
c-common.h (warn_array_subscript_range): New function.
* c-common.h (warn_array_subscript_range): New function. * c-common.c (warn_array_subscript_range): Ditto. * tree-vrp.c (check_array_ref): Corrected code to agree with comment, ignoring only arrays of size 0 or size 1. * c-typeck.c (build_array_ref): Call warn_array_subscript_range. * testsuite/gcc.dg/Warray-bounds.c: Updated for frontend warnings, additional tests for arrays of size 0 and size 1. * testsuite/g++.dg/warn/Warray-bounds.c: Ditto. * testsuite/gcc.dg/Warray-bounds-noopt.c: New testcase. * testsuite/g++.dg/warn/Warray-bounds-noopt.c: Ditto. * typeck.c (build_array_ref): Call warn_array_subscript_range. From-SVN: r134865
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index c403bee..4f4a414 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -893,6 +893,7 @@ extern int complete_array_type (tree *, tree, bool);
extern tree builtin_type_for_size (int, bool);
extern void warn_array_subscript_with_type_char (tree);
+extern bool warn_array_subscript_range (const_tree, const_tree);
extern void warn_about_parentheses (enum tree_code, enum tree_code,
enum tree_code);
extern void warn_for_unused_label (tree label);