This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: command line options that start -b or -V
- From: Devang Patel <dpatel at apple dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Devang Patel <dpatel at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Dec 2002 17:41:50 -0800
- Subject: Re: PATCH: command line options that start -b or -V
On Thursday, December 12, 2002, at 02:15 PM, Geoff Keating wrote:
I've thought about this a bit, and it might be better if we use the
heuristic that all configuration names must have at least one dash '-'
in them, so just something like
(argv[1][1] == 'V' ||
(argv[1][1] == 'b' && strchr (argv[1] + 2, '-') != NULL))
in the two places where the test for 'V' or 'b' is made.
OK to commit this patch (to mainline) ?
Thank you,
-Devang
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.349
diff -Idpatel.pbxuser -c -3 -p -r1.349 gcc.c
*** gcc.c 26 Nov 2002 07:03:48 -0000 1.349
--- gcc.c 13 Dec 2002 01:43:23 -0000
*************** process_command (argc, argv)
*** 3048,3055 ****
/* If there is a -V or -b option (or both), process it now, before
trying to interpret the rest of the command line. */
if (argc > 1 && argv[1][0] == '-'
! && (argv[1][1] == 'V' || argv[1][1] == 'b'))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
--- 3048,3058 ----
/* If there is a -V or -b option (or both), process it now, before
trying to interpret the rest of the command line. */
+ /* Use heuristic that all configuration names must have at least
one dash '-'.
+ This allows to pass options that start with -b. */
if (argc > 1 && argv[1][0] == '-'
! && (argv[1][1] == 'V'
! || (argv[1][1] == 'b' && strchr (argv[1] + 2, '-') != NULL)))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;