egcs 1.1.2 win32 dir bug

Mumit Khan khan@xraylith.wisc.edu
Fri Apr 30 18:32:00 GMT 1999


On Thu, 29 Apr 1999, Mikey wrote:

> the change in DIR_SEPARATOR in xm-cygwin32.h
> causes this. egcs 1.1.2 outputs tmp\file.[ios]
> when given a file argument tmp\file.c[c]
> 
> at the bash prompt
> 
> gcc -save-temps -c tmp\\main.c
> outputs tmp\\main.i tmp\\main.o tmp\\main.s
> 
> gcc -c tmp/main.c
> outputs ./main.i ./main.o ./main.s
> 
> apparently the input_basename argument substituted for %b in specs
> is being output incorrectly when the dir separator is '\\' in input_filename.

For Cygwin, people should be using POSIX pathnames only to avoid these
misfeatures (note that I'm not calling it a bug ;-). For Mingw, it should
work as is.

For egcs-1.2, now there's DIR_SEPARATOR ('/') and DIR_SEPARATOR_2 ('\\'), 
and we check for both. I just tested this and I get the same output 
locations for both '\\' and '/' cases. Here's the new macro that checks
for dir separator.

  /* Define IS_DIR_SEPARATOR.  */
  #ifndef DIR_SEPARATOR_2
  # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  #else /* DIR_SEPARATOR_2 */
  # define IS_DIR_SEPARATOR(ch) \
	  (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  #endif /* DIR_SEPARATOR_2 */

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list