+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.
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 ();
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'. */
-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
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.
#include "ggc.h"
#include "tree.h"
#include "hashtable.h"
-#include "flags.h"
#include "toplev.h"
/* The "" allocated string. */
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
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
= (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
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'. */
}
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)
}
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);
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));