Commit fd5e7009 by Doug Evans

gcc.c (do_spec_1): Allow leading text in version string.

	* gcc.c (do_spec_1): Allow leading text in version string.
	Delete support for default minor number = 0.

From-SVN: r12264
parent 8cfe18d6
......@@ -3735,26 +3735,35 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{
int c1 = *p++; /* Select first or second version number. */
char *v = compiler_version;
char *q, *copy;
char *q;
/* The format of the version string is
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
/* Ignore leading non-digits. i.e. "foo-" in "foo-2.7.2". */
while (! isdigit (*v))
v++;
if (v > compiler_version && v[-1] != '-')
abort ();
/* If desired, advance to second version number. */
if (c1 == '2')
{
/* Set V after the first period. */
while (*v != 0 && *v != ' ' && *v != '.')
v++;
if (*v == '.')
while (isdigit (*v))
v++;
if (*v != '.')
abort ();
v++;
}
/* Set Q at the next period or at the end. */
q = v;
while (*q != 0 && *q != ' ' && *q != '.')
while (isdigit (*q))
q++;
/* Empty string means zero. */
if (v == q)
{
v = "0";
q = v + 1;
}
if (*q != 0 && *q != ' ' && *q != '.' && *q != '-')
abort ();
/* Put that part into the command. */
obstack_grow (&obstack, v, q - v);
arg_going = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment