This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Handle digits in %g, %| and %m argument


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]