aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1996-02-19 10:22:57 +0000
committerJason Merrill <merrill@gnu.org>1996-02-19 10:22:57 +0000
commitd51f93635dca0c4d50238f50a9f68d55ad14ac7c (patch)
tree405d2d0ed4282f3b10baf257836669f8681509e6
parentd669f5da3c4c5c74f5a55d3c81c795b44aa877aa (diff)
downloadgcc-d51f93635dca0c4d50238f50a9f68d55ad14ac7c.zip
gcc-d51f93635dca0c4d50238f50a9f68d55ad14ac7c.tar.gz
gcc-d51f93635dca0c4d50238f50a9f68d55ad14ac7c.tar.bz2
warn_sign_compare
From-SVN: r11298
-rw-r--r--gcc/c-decl.c9
-rw-r--r--gcc/c-tree.h4
-rw-r--r--gcc/toplev.c2
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f28b026..65dfa01 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -541,6 +541,10 @@ int warn_parentheses;
int warn_missing_braces;
+/* Warn about comparison of signed and unsigned values. */
+
+int warn_sign_compare;
+
/* Nonzero means `$' can be in an identifier.
See cccp.c for reasons why this breaks some obscure ANSI C programs. */
@@ -711,6 +715,10 @@ c_decode_option (p)
warn_missing_braces = 1;
else if (!strcmp (p, "-Wno-missing-braces"))
warn_missing_braces = 0;
+ else if (!strcmp (p, "-Wsign-compare"))
+ warn_sign_compare = 1;
+ else if (!strcmp (p, "-Wno-sign-compare"))
+ warn_sign_compare = 0;
else if (!strcmp (p, "-Wall"))
{
/* We save the value of warn_uninitialized, since if they put
@@ -726,6 +734,7 @@ c_decode_option (p)
warn_char_subscripts = 1;
warn_parentheses = 1;
warn_missing_braces = 1;
+ warn_sign_compare = 1;
}
else
return 0;
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index bb90048..4538f4b 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -477,6 +477,10 @@ extern int warn_parentheses;
extern int warn_missing_braces;
+/* Warn about comparison of signed and unsigned values. */
+
+int warn_sign_compare;
+
/* Nonzero means this is a function to call to perform comptypes
on two record types. */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 4690f16..052f703 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -639,6 +639,8 @@ char *lang_options[] =
"-Wno-pointer-arith",
"-Wredundant-decls",
"-Wno-redundant-decls",
+ "-Wsign-compare",
+ "-Wno-sign-compare",
"-Wstrict-prototypes",
"-Wno-strict-prototypes",
"-Wtraditional",