This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
c++ lang_decode_option
- To: gcc-patches at gcc dot gnu dot org
- Subject: c++ lang_decode_option
- From: Richard Henderson <rth at twiddle dot net>
- Date: Thu, 1 Jun 2000 02:43:05 -0700
The bsearch typo blows up spectacularly when sizeof(char*) != 4.
And would have been more visible on x86 but for a missing comma.
r~
* decl2.c (unsupported_options): Fix typo, make const.
(lang_decode_option): Fix bsearch argument order.
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.358
diff -c -p -d -r1.358 decl2.c
*** decl2.c 2000/05/31 19:27:12 1.358
--- decl2.c 2000/06/01 08:21:58
*************** lang_f_options[] =
*** 562,571 ****
/* The list of `-f' options that we no longer support. The `-f'
prefix is not given in this table. The `-fno-' variants are not
listed here. This table must be kept in alphabetical order. */
! static const char *unsupported_options[] = {
"all-virtual",
"enum-int-equiv",
! "guiding-decls"
"nonnull-objects",
"this-is-variable",
};
--- 562,571 ----
/* The list of `-f' options that we no longer support. The `-f'
prefix is not given in this table. The `-fno-' variants are not
listed here. This table must be kept in alphabetical order. */
! static const char * const unsupported_options[] = {
"all-virtual",
"enum-int-equiv",
! "guiding-decls",
"nonnull-objects",
"this-is-variable",
};
*************** lang_decode_option (argc, argv)
*** 629,637 ****
caller that the option was processed successfully. */
if (bsearch (&positive_option,
unsupported_options,
- sizeof (unsupported_options[0]),
(sizeof (unsupported_options)
/ sizeof (unsupported_options[0])),
compare_options))
{
warning ("-f%s is no longer supported", p);
--- 629,637 ----
caller that the option was processed successfully. */
if (bsearch (&positive_option,
unsupported_options,
(sizeof (unsupported_options)
/ sizeof (unsupported_options[0])),
+ sizeof (unsupported_options[0]),
compare_options))
{
warning ("-f%s is no longer supported", p);