egcs/c-torture.exp/.cexp and 14 char limit

Philippe De Muyter phdm@macqel.be
Fri Dec 5 01:13:00 GMT 1997


Please include the following patch in the egcs source tree.
Without it, c-torture.exp tries to execute some C programs as Expect programs :)


Fri Dec  5 09:52:54 1997  Philippe De Muyter  <phdm@macqel.be>

	* lib/c-torture.exp (c-torture, c-torture-execute): Avoid confusing
 	.c files as .cexp files on 14-char limited filesystems.

--- ./lib/c-torture.exp	Fri Dec  5 09:47:40 1997
+++ ./lib/c-torture.exp	Fri Dec  5 00:38:05 1997
@@ -135,11 +135,15 @@
 
     # Check for alternate driver.
     if [file exists [file rootname $src].cexp] {
-	verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
-	set done_p 0
-	catch "set done_p \[source [file rootname $src].cexp\]"
-	if { $done_p } {
-	    return
+	# Avoid false positive when working on a 14-char fs and src has 14 char.
+	catch "exec cmp $src \[file rootname $src\].cexp" exec_output
+	    if ![string match "" $exec_output] then {
+	    verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
+	    set done_p 0
+	    catch "set done_p \[source [file rootname $src].cexp\]"
+	    if { $done_p } {
+		return
+	    }
 	}
     }
    
@@ -290,13 +294,17 @@
 
     # Check for alternate driver.
     if [file exists [file rootname $src].cexp] {
-	verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
-	set done_p 0
-	catch "set done_p \[source [file rootname $src].cexp\]"
-	if { $done_p } {
-	    return
+	# Avoid false positive when working on a 14-char fs and src has 14 char.
+	catch "exec cmp $src \[file rootname $src\].cexp" exec_output
+	    if ![string match "" $exec_output] then {
+		verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
+		set done_p 0
+		catch "set done_p \[source [file rootname $src].cexp\]"
+		if { $done_p } {
+		    return
+		}
+	    }
 	}
-    }
    
     # Look for a loop within the source code - if we don't find one,
     # don't pass -funroll[-all]-loops.



More information about the Gcc mailing list