diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-10-23 18:14:31 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-10-23 18:14:31 +0000 |
commit | 6c36d76bf6521dd1cc09b8d7e379a02d138ffd53 (patch) | |
tree | a86518d1f2373ba547d08bd0867d006b5db75f24 /gcc/c-common.c | |
parent | 28a8851e654560d565e7270812ea1b2e1c33b14d (diff) | |
download | gcc-6c36d76bf6521dd1cc09b8d7e379a02d138ffd53.zip gcc-6c36d76bf6521dd1cc09b8d7e379a02d138ffd53.tar.gz gcc-6c36d76bf6521dd1cc09b8d7e379a02d138ffd53.tar.bz2 |
c-common.c (warn_div_by_zero): New.
* c-common.c (warn_div_by_zero): New.
* c-common.h (warn_div_by_zero): New.
* c-decl.c (c_decode_option): Take it on the command line.
* c-typeck.c (build_binary_op): Warn about division by zero.
* doc/invoke.texi: Document the new command line option, fix
documentation of -Wmultichar.
* testsuite/gcc.dg/divbyzero.c: New tests.
* testsuite/gcc.dg/noncompile/20010524-1.c: Update.
From-SVN: r46439
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 6a4e1af..bc81a1a 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -194,6 +194,9 @@ int flag_short_wchar; int warn_sequence_point; +/* Nonzero means to warn about compile-time division by zero. */ +int warn_div_by_zero = 1; + /* The elements of `ridpointers' are identifier nodes for the reserved type names and storage classes. It is indexed by a RID_... value. */ tree *ridpointers; |