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
This commit is contained in:
Neil Booth 2001-05-27 21:04:28 +00:00 committed by Neil Booth
parent 7b78a14a37
commit 84b7783609
7 changed files with 16 additions and 63 deletions

View File

@ -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.

View File

@ -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 ();

View File

@ -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'. */

View File

@ -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.

View File

@ -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

View File

@ -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);

View File

@ -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));