aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@lisa.cygnus.com>1996-12-20 20:26:35 +0000
committerBrendan Kehoe <brendan@gcc.gnu.org>1996-12-20 15:26:35 -0500
commit1bf2b2d2a86ccae42e47a88be0c3cae16ecf352f (patch)
tree322145e5809e204eae5dce2d235bb10ae6f3b94d
parent82c6faa8bafe35d63fd906899140eae9d98b9b55 (diff)
downloadgcc-1bf2b2d2a86ccae42e47a88be0c3cae16ecf352f.zip
gcc-1bf2b2d2a86ccae42e47a88be0c3cae16ecf352f.tar.gz
gcc-1bf2b2d2a86ccae42e47a88be0c3cae16ecf352f.tar.bz2
g++spec.c (lang_specific_driver): Put missing hyphen in front of arguments we compare against.
* 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. From-SVN: r13338
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/g++spec.c25
2 files changed, 17 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c178546..e0ad92a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+Fri Dec 20 12:17:12 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * 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.
+
Mon Dec 16 22:43:31 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
* cp-tree.h (ptr_reasonably_similar): Add decl.
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 881e821..e4bfc8d 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. */