On 15 Feb 2003 at 2:56, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
Were you expecting problems? If so, what problems were you expecting? There should be no error. The error would appear in GPC if you did not use "-DTARGET_W9x", because the GPC driver would have problems with the forward slash. The gcc driver will not have such problems, as a result of recent changes in it (which may or may not have been mirrored in the GPC driver - I didn't bother checking), which would compensate for either forward or back slashes.
I synched gpc.c with gcc.c from gcc-3.2.1 (except for automake and other GPC specific things which should have no influence on these issues). So if it works with gcc-3.2.1, but not with GPC, I suggest further debugging before we patch the machine file.
You synched with the FSF sources, I presume. The Mingw special sources contain their own patches, and that is where this is dealt with. The attached diff applies those patches to the GPC driver. If used, then we don't have to patch the machine file. Either way, a specific Mingw patch has to be applied. The question is whether it is best incorporated into gpc.c once and for all, or patched into the machine file every time one builds a new version of GPC. I would probably favour the former (i.e., incorporate it into gpc.c now) and forget patching the machine file.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
*** gcc/p/gpc.c.orig Wed Jan 29 05:01:54 2003 --- gcc/p/gpc.c Sat Feb 15 07:52:42 2003 *************** add_prefix (pprefix, prefix, component, *** 2988,2993 **** --- 2988,3011 ---- (*prev) = pl; }
+ #if defined (__MINGW32__) + static char * + canon_filename (char *fname) + { + char* p = fname; + + while (*p) + { + if (*p == '/') + *p = '\'; + p++; + } + return fname; + } + #else + #define canon_filename(f) f + #endif + /* Execute the command specified by the arguments on the current line of spec. When using pipes, this includes several piped-together commands with `|' between them. *************** execute () *** 3026,3032 **** string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, 0);
if (string) ! commands[0].argv[0] = string;
for (n_commands = 1, i = 0; i < argbuf_index; i++) if (strcmp (argbuf[i], "|") == 0) --- 3044,3050 ---- string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, 0);
if (string) ! commands[0].argv[0] = canon_filename(string);
for (n_commands = 1, i = 0; i < argbuf_index; i++) if (strcmp (argbuf[i], "|") == 0) *************** execute () *** 3040,3046 **** string = find_a_file (&exec_prefixes, commands[n_commands].prog, X_OK, 0); if (string) ! commands[n_commands].argv[0] = string; n_commands++; }
--- 3058,3064 ---- string = find_a_file (&exec_prefixes, commands[n_commands].prog, X_OK, 0); if (string) ! commands[n_commands].argv[0] = canon_filename(string); n_commands++; }