summaryrefslogtreecommitdiffstats
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authordpatel <dpatel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-10 23:41:42 +0000
committerdpatel <dpatel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-10 23:41:42 +0000
commit89b4de106f74da75d1472cb68a77e094d8db39eb (patch)
tree984d98b935666a18064dc2fa49e37e242a2e6350 /gcc/gcc.c
parent783d704311b20433aedbd19840cccbe652c6cc22 (diff)
downloadppe42-gcc-89b4de106f74da75d1472cb68a77e094d8db39eb.tar.gz
ppe42-gcc-89b4de106f74da75d1472cb68a77e094d8db39eb.zip
PR/9394
* gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove. (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove. * gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add. (DEFAULT_WORD_SWITCH_TAKES_ARG): Add. * cppspec.c (DEFAULT_SWTICH_TAKES_ARG): Remove. (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove. cp * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWITCH_TAKES_ARG. testsuite * g++.dg/cpp/c++_cmd_1.C: New test. * g++.dg/cpp/c++_cmd_1.h: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64144 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 301abfc6212..1aa02528d87 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -819,30 +819,10 @@ struct user_specs
static struct user_specs *user_specs_head, *user_specs_tail;
-/* This defines which switch letters take arguments. */
-
-#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
- ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
- || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
- || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
- || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'B' || (CHAR) == 'b')
-
#ifndef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
#endif
-/* This defines which multi-letter switches take arguments. */
-
-#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
- || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \
- || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
- || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
- || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
- || !strcmp (STR, "isystem") || !strcmp (STR, "-param") \
- || !strcmp (STR, "specs") \
- || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
-
#ifndef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
@@ -3162,8 +3142,11 @@ process_command (argc, argv)
/* 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'))
+ && (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;
OpenPOWER on IntegriCloud