aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-05-27 21:04:28 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-05-27 21:04:28 +0000
commit84b7783609980a52d9b4471bc3c558ea862dcb62 (patch)
treeddc105f7ab823ba9b7f49c48da4aa669a5fe6490
parent7b78a14a37cd517efee40901397dc272ecb55211 (diff)
downloadgcc-84b7783609980a52d9b4471bc3c558ea862dcb62.zip
gcc-84b7783609980a52d9b4471bc3c558ea862dcb62.tar.gz
gcc-84b7783609980a52d9b4471bc3c558ea862dcb62.tar.bz2
c-decl.c (init_decl_processing): Don't call start_identifier_warnings.
* c-decl.c (init_decl_processing): Don't call start_identifier_warnings. * flags.h (warn_id_clash, id_clash_len): Remove. * stringpool.c: Don't include flags.h. (scan_for_clashes, do_identifier_warnings, start_identifier_warnings): Remove. * toplev.c (warn_id_clash, id_clash_len): Remove. (display_help): Don't document -Wid-clash. (decode_W_option): Print warning on -Wid-clash. * tree.h (start_identifier_warnings): Remove. * invoke.texi: Remove documentation of -Wid-clash. From-SVN: r42665
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/flags.h6
-rw-r--r--gcc/invoke.texi7
-rw-r--r--gcc/stringpool.c35
-rw-r--r--gcc/toplev.c14
-rw-r--r--gcc/tree.h1
7 files changed, 16 insertions, 63 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73105b8..c239ac1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2001-05-27 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-decl.c (init_decl_processing):
+ Don't call start_identifier_warnings.
+ * flags.h (warn_id_clash, id_clash_len): Remove.
+ * stringpool.c: Don't include flags.h.
+ (scan_for_clashes, do_identifier_warnings,
+ start_identifier_warnings): Remove.
+ * toplev.c (warn_id_clash, id_clash_len): Remove.
+ (display_help): Don't document -Wid-clash.
+ (decode_W_option): Print warning on -Wid-clash.
+ * tree.h (start_identifier_warnings): Remove.
+ * invoke.texi: Remove documentation of -Wid-clash.
+
2001-05-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fixinc/fixtests.c: Declare entries in ENV_TABLE.
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 75c8f8a..7c02d05 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3061,8 +3061,6 @@ init_decl_processing ()
make_fname_decl = c_make_fname_decl;
start_fname_decls ();
- start_identifier_warnings ();
-
/* Prepare to check format strings against argument lists. */
init_function_format_info ();
diff --git a/gcc/flags.h b/gcc/flags.h
index 46168a0..38ae79a 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -142,12 +142,6 @@ extern int warn_missing_noreturn;
extern int warn_cast_align;
-/* Nonzero means warn about any identifiers that match in the first N
- characters. The value N is in `id_clash_len'. */
-
-extern int warn_id_clash;
-extern unsigned int id_clash_len;
-
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 80cd33e..4155345 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -208,7 +208,7 @@ in the following sections.
-Wconversion -Wdisabled-optimization -Werror @gol
-Wfloat-equal -Wformat -Wformat=2 @gol
-Wformat-nonliteral -Wformat-security @gol
--Wid-clash-@var{len} -Wimplicit -Wimplicit-int @gol
+-Wimplicit -Wimplicit-int @gol
-Wimplicit-function-declaration @gol
-Werror-implicit-function-declaration @gol
-Wimport -Winline @gol
@@ -2232,11 +2232,6 @@ Warn if an undefined identifier is evaluated in an @samp{#if} directive.
Warn whenever a local variable shadows another local variable, parameter or
global variable or whenever a built-in function is shadowed.
-@item -Wid-clash-@var{len}
-Warn whenever two distinct identifiers match in the first @var{len}
-characters. This may help you prepare a program that will compile
-with certain obsolete, brain-damaged compilers.
-
@item -Wlarger-than-@var{len}
Warn whenever an object of larger than @var{len} bytes is defined.
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index 7abca36..62d2a06 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -32,7 +32,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "tree.h"
#include "hashtable.h"
-#include "flags.h"
#include "toplev.h"
/* The "" allocated string. */
@@ -47,13 +46,10 @@ const char digit_vector[] = {
struct ht *ident_hash;
static struct obstack string_stack;
-static int do_identifier_warnings;
static hashnode alloc_node PARAMS ((hash_table *));
static int mark_ident PARAMS ((struct cpp_reader *, hashnode, const PTR));
static void mark_ident_hash PARAMS ((void *));
-static int scan_for_clashes PARAMS ((struct cpp_reader *, hashnode,
- const char *));
/* Initialize the string pool. */
void
@@ -131,28 +127,6 @@ maybe_get_identifier (text)
return NULL_TREE;
}
-/* If this identifier is longer than the clash-warning length,
- do a brute force search of the entire table for clashes. */
-
-static int
-scan_for_clashes (pfile, h, text)
- struct cpp_reader *pfile ATTRIBUTE_UNUSED;
- hashnode h;
- const char *text;
-{
- tree node = HT_IDENT_TO_GCC_IDENT (h);
-
- if (IDENTIFIER_LENGTH (node) >= id_clash_len
- && !memcmp (IDENTIFIER_POINTER (node), text, id_clash_len))
- {
- warning ("\"%s\" and \"%s\" identical in first %d characters",
- text, IDENTIFIER_POINTER (node), id_clash_len);
- return 0;
- }
-
- return 1;
-}
-
/* Record the size of an identifier node for the language in use.
SIZE is the total size in bytes.
This is called by the language-specific files. This must be
@@ -166,15 +140,6 @@ set_identifier_size (size)
= (size - sizeof (struct tree_common)) / sizeof (tree);
}
-/* Enable warnings on similar identifiers (if requested).
- Done after the built-in identifiers are created. */
-
-void
-start_identifier_warnings ()
-{
- do_identifier_warnings = 1;
-}
-
/* Report some basic statistics about the string pool. */
void
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 2a7f681..0cb7875 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1455,12 +1455,6 @@ int warn_return_type;
int warn_cast_align;
-/* Nonzero means warn about any identifiers that match in the first N
- characters. The value N is in `id_clash_len'. */
-
-int warn_id_clash;
-unsigned int id_clash_len;
-
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
@@ -3905,7 +3899,6 @@ display_help ()
}
printf (_(" -Wunused Enable unused warnings\n"));
- printf (_(" -Wid-clash-<num> Warn if 2 identifiers have the same first <num> chars\n"));
printf (_(" -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n"));
printf (_(" -p Enable function profiling\n"));
#if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER)
@@ -4239,12 +4232,7 @@ decode_W_option (arg)
}
if ((option_value = skip_leading_substring (arg, "id-clash-")))
- {
- id_clash_len = read_integral_parameter (option_value, arg - 2, -1);
-
- if (id_clash_len != -1)
- warn_id_clash = 1;
- }
+ warning ("-Wid-clash-LEN is no longer supported");
else if ((option_value = skip_leading_substring (arg, "larger-than-")))
{
larger_than_size = read_integral_parameter (option_value, arg - 2, -1);
diff --git a/gcc/tree.h b/gcc/tree.h
index 838368b..6821b06 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2718,7 +2718,6 @@ extern void expand_function_start PARAMS ((tree, int));
extern int real_onep PARAMS ((tree));
extern int real_twop PARAMS ((tree));
-extern void start_identifier_warnings PARAMS ((void));
extern void gcc_obstack_init PARAMS ((struct obstack *));
extern void init_obstacks PARAMS ((void));
extern void build_common_tree_nodes PARAMS ((int));