aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/g++spec.c
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@lisa.cygnus.com>1996-12-20 20:26:35 +0000
committerBrendan Kehoe <brendan@lisa.cygnus.com>1996-12-20 20:26:35 +0000
commit0506a2598bafa03cfae3a06ae60178dbb94e4fcf (patch)
tree322145e5809e204eae5dce2d235bb10ae6f3b94d /gcc/cp/g++spec.c
parent850d0dd82f2fe12f8fdaefc9e1c3ebb2171af4e2 (diff)
* g++spec.c (lang_specific_driver): Put missing hyphen in front of
arguments we compare against. Start the count of I at 1, not 0, since argv[0] is still the command. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@13338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/g++spec.c')
-rw-r--r--gcc/cp/g++spec.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 881e8213b1d..e4bfc8d6d88 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -76,8 +76,7 @@ lang_specific_driver (fn, in_argc, in_argv)
args = (int *) xmalloc (argc * sizeof (int));
bzero ((char *) args, argc * sizeof (int));
- /* NOTE: We start at 0 now, not 1. */
- for (i = 0; i < argc; i++)
+ for (i = 1; i < argc; i++)
{
/* If the previous option took an argument, we swallow it here. */
if (quote)
@@ -93,13 +92,13 @@ lang_specific_driver (fn, in_argc, in_argv)
if (argv[i][0] == '-')
{
- if (library != 0 && (strcmp (argv[i], "nostdlib") == 0
- || strcmp (argv[i], "nodefaultlibs") == 0))
+ if (library != 0 && (strcmp (argv[i], "-nostdlib") == 0
+ || strcmp (argv[i], "-nodefaultlibs") == 0))
{
library = 0;
}
- else if (strcmp (argv[i], "lm") == 0
- || strcmp (argv[i], "lmath") == 0
+ else if (strcmp (argv[i], "-lm") == 0
+ || strcmp (argv[i], "-lmath") == 0
#ifdef ALT_LIBM
|| strcmp (argv[i], ALT_LIBM) == 0
#endif
@@ -108,29 +107,27 @@ lang_specific_driver (fn, in_argc, in_argv)
args[i] |= MATHLIB;
need_math = 0;
}
- else if (strcmp (argv[i], "lc") == 0)
+ else if (strcmp (argv[i], "-lc") == 0)
args[i] |= WITHLIBC;
- else if (strcmp (argv[i], "v") == 0)
+ else if (strcmp (argv[i], "-v") == 0)
{
saw_verbose_flag = 1;
- /* We now see if this is 1, since we are doing the switches
- differently. */
- if (argc == 1)
+ if (argc == 2)
{
/* If they only gave us `-v', don't try to link
in libg++. */
library = 0;
}
}
- else if (strncmp (argv[i], "x", 2) == 0)
+ else if (strncmp (argv[i], "-x", 2) == 0)
saw_speclang = 1;
else if (((argv[i][2] == '\0'
&& (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
- || strcmp (argv[i], "Tdata") == 0))
+ || strcmp (argv[i], "-Tdata") == 0))
quote = argv[i];
else if (library != 0 && ((argv[i][2] == '\0'
&& (char *) strchr ("cSEM", argv[i][1]) != NULL)
- || strcmp (argv[i], "MM") == 0))
+ || strcmp (argv[i], "-MM") == 0))
{
/* Don't specify libraries if we won't link, since that would
cause a warning. */