diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1994-04-06 12:35:10 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1994-04-06 12:35:10 -0700 |
commit | 7e44eda6c269fd1eb3cd9ceb86506ac2d155ad71 (patch) | |
tree | e83b617490bc386612ce489463d5e7f0eac157b0 /gcc | |
parent | 3797f4d4d4f683fdfb8e42fb00a91783cc278d8b (diff) | |
download | gcc-7e44eda6c269fd1eb3cd9ceb86506ac2d155ad71.zip gcc-7e44eda6c269fd1eb3cd9ceb86506ac2d155ad71.tar.gz gcc-7e44eda6c269fd1eb3cd9ceb86506ac2d155ad71.tar.bz2 |
(finish_decl): Correct typo in use of tree_int_cst_sgn.
From-SVN: r6989
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 53b08ee..1e818a0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3469,8 +3469,11 @@ finish_decl (decl, init, asmspec_tree) DECL_EXTERNAL (decl) = 1; } + /* TYPE_MAX_VALUE is always one less than the number of elements + in the array, because we start counting at zero. Therefore, + warn only if the value is less than zero. */ if (pedantic && TYPE_DOMAIN (type) != 0 - && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) <= 0) + && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0) error_with_decl (decl, "zero or negative size array `%s'"); layout_decl (decl, 0); |