Commit c31cddfd by Neil Booth Committed by Neil Booth

c-opts.c (c_common_init_options): Check option array is sorted if checking enabled.

	* c-opts.c (c_common_init_options): Check option array is
	sorted if checking enabled.

From-SVN: r56241
parent f076f0ce
2002-08-13 Neil Booth <neil@daikokuya.co.uk>
* c-opts.c (c_common_init_options): Check option array is
sorted if checking enabled.
2002-08-13 Gabriel Dos Reis <gdr@nerim.net>
* c-pretty-print.c: #include "c-tree.h".
......
......@@ -495,6 +495,14 @@ c_common_init_options (lang)
runtime. */
qsort (cl_options, N_OPTS, sizeof (struct cl_option), opt_comp);
#endif
#if ENABLE_CHECKING
size_t i;
for (i = 1; i < N_OPTS; i++)
if (strcmp (cl_options[i - 1].opt_text, cl_options[i].opt_text) >= 0)
error ("options array incorrectly sorted: %s is before %s",
cl_options[i - 1].opt_text, cl_options[i].opt_text);
#endif
c_language = lang;
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment