summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-13 06:48:18 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-13 06:48:18 +0000
commit448b2e1261b945ff4b50fd446432b4fd0066554b (patch)
treea0fdb2c9eaea85457195caca65b57d693edf0d99 /gcc
parented22b9fe5e9b84fc8e6c212b8fa14452e3158d9c (diff)
downloadgcc-448b2e1261b945ff4b50fd446432b4fd0066554b.tar.gz
* c-opts.c (c_common_init_options): Check option array is
sorted if checking enabled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56241 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-opts.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e125b611b10..6284939c4e1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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".
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 189cb1ba9e1..2be99714775 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -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);