This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Handle digits in %g, %| and %m argument
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 10 Oct 2005 06:12:12 -0400
- Subject: [PATCH] Handle digits in %g, %| and %m argument
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Fortran uses -o %|.f95 in its specs, but without this patch the driver
treats this as %|.f followed immediately by 95. Which means that
when the driver is creating the filename, it will create say
/tmp/ccjrY4pv.f as empty file, then cc1 will be called with
-o /tmp/ccjrY4pv.f95 etc. and afterwards we end up with an empty
left-over file /tmp/ccjrY4pv.f.
Ok for HEAD/4.0?
2005-10-10 Jakub Jelinek <jakub@redhat.com>
* gcc.c (do_spec_1): Allow digits in %g, %| and %m argument.
--- gcc/gcc.c.jj 2005-08-16 16:23:58.000000000 +0200
+++ gcc/gcc.c 2005-10-10 12:02:14.000000000 +0200
@@ -4705,7 +4705,7 @@ do_spec_1 (const char *spec, int inswitc
arg_going = 1;
/* consume suffix */
- while (*p == '.' || ISALPHA ((unsigned char) *p))
+ while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
@@ -4717,7 +4717,7 @@ do_spec_1 (const char *spec, int inswitc
if (use_pipes)
{
/* consume suffix */
- while (*p == '.' || ISALPHA ((unsigned char) *p))
+ while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
@@ -4735,14 +4735,14 @@ do_spec_1 (const char *spec, int inswitc
const char *suffix = p;
char *saved_suffix = NULL;
- while (*p == '.' || ISALPHA ((unsigned char) *p))
+ while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
suffix_length = p - suffix;
if (p[0] == '%' && p[1] == 'O')
{
p += 2;
/* We don't support extra suffix characters after %O. */
- if (*p == '.' || ISALPHA ((unsigned char) *p))
+ if (*p == '.' || ISALNUM ((unsigned char) *p))
fatal ("spec '%s' has invalid '%%0%c'", spec, *p);
if (suffix_length == 0)
suffix = TARGET_OBJECT_SUFFIX;
Jakub