diff options
author | dpatel <dpatel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-10 23:41:42 +0000 |
---|---|---|
committer | dpatel <dpatel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-10 23:41:42 +0000 |
commit | 89b4de106f74da75d1472cb68a77e094d8db39eb (patch) | |
tree | 984d98b935666a18064dc2fa49e37e242a2e6350 | |
parent | 783d704311b20433aedbd19840cccbe652c6cc22 (diff) | |
download | gcc-89b4de106f74da75d1472cb68a77e094d8db39eb.tar.gz |
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
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/g++spec.c | 2 | ||||
-rw-r--r-- | gcc/cppspec.c | 22 | ||||
-rw-r--r-- | gcc/gcc.c | 25 | ||||
-rw-r--r-- | gcc/gcc.h | 22 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/c++_cmd_1.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/c++_cmd_1.h | 6 |
9 files changed, 67 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4a3f89fc4b..fab6a903713 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ + +2003-03-10 Devang Patel <dpatel@apple.com> + + PR c++/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_SWITCH_TAKES_ARG): Remove. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove. + 2003-03-10 Steven Bosscher <s.bosscher@student.tudelft.nl> PR optimization/7189 @@ -5,6 +16,7 @@ check_function_return_warnings up to just after delete_unreachable_blocks. + 2003-03-10 Stephane Carrez <stcarrez@nerim.fr> * config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9f70757d19d..93d3f22d286 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2003-03-10 Devang Patel <dpatel@apple.com> + + PR c++/9394 + * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG. 2003-03-10 Jason Merrill <jason@redhat.com> PR c++/9798 diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 75a1d7c28a4..d2f99d9990c 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -189,6 +189,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) else if (strcmp (argv[i], "-static-libgcc") == 0 || strcmp (argv[i], "-static") == 0) shared_libgcc = 0; + else if (DEFAULT_WORD_SWITCH_TAKES_ARG (&argv[i][1])) + i++; else /* Pass other options through. */ continue; diff --git a/gcc/cppspec.c b/gcc/cppspec.c index ef7238953fd..1eba17c7719 100644 --- a/gcc/cppspec.c +++ b/gcc/cppspec.c @@ -31,32 +31,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA assume the user knows what they're doing. If no explicit input is mentioned, it will read stdin. */ -/* Snarfed from gcc.c: */ - -/* 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) == 'V' \ - || (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, "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 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; diff --git a/gcc/gcc.h b/gcc/gcc.h index feab0ef0710..06691bd9f6b 100644 --- a/gcc/gcc.h +++ b/gcc/gcc.h @@ -31,6 +31,28 @@ struct spec_function const char *(*func) PARAMS ((int, const char **)); }; +/* 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) == 'V' \ + || (CHAR) == 'B' || (CHAR) == 'b') + +/* 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")) + + /* These are exported by gcc.c. */ extern int do_spec PARAMS ((const char *)); extern void record_temp_file PARAMS ((const char *, int, int)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7440a8ae255..233d4c1a140 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-03-10 Devang Patel <dpatel@apple.com> + + * g++.dg/cpp/c++_cmd_1.C: New test. + * g++.dg/cpp/c++_cmd_1.h: New file. + 2003-03-10 Segher Boessenkool <segher@koffie.nl> * gcc.dg/altivec-9.c: New file. diff --git a/gcc/testsuite/g++.dg/cpp/c++_cmd_1.C b/gcc/testsuite/g++.dg/cpp/c++_cmd_1.C new file mode 100644 index 00000000000..e4e0482936b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/c++_cmd_1.C @@ -0,0 +1,12 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ +/* { dg-options "-c -include ${srcdir}/g++.dg/cpp/c++_cmd_1.h" } */ + +/* Contributed by Devang Patel <dpatel@apple.com> */ + +int main () +{ + return 0; +} + diff --git a/gcc/testsuite/g++.dg/cpp/c++_cmd_1.h b/gcc/testsuite/g++.dg/cpp/c++_cmd_1.h new file mode 100644 index 00000000000..06f4941bc54 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/c++_cmd_1.h @@ -0,0 +1,6 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. */ + +/* Contributed by Devang Patel <dpatel@apple.com> */ + +/* Header file for c++_cmd_1.C */ + |