This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st yles
- From: Aleksandar Ristovski <ARistovski at qnx dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Ryan Mansfield <RMansfield at qnx dot com>
- Date: Sat, 5 Jan 2008 10:44:02 -0500
- Subject: RE: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st yles
>
> I think _X is not appropriate here. How about _POSIX?
Eli, please take a look at my modified patch:
http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00154.html
it includes _POSIX spelling and better comments.
>
> > +
> > +/* Universal macros, to be used on paths that could be either
> > + POSIX or DOS. */
>
> What would be the use of these _ANY predicates? We always run on a
> platform that is either DOS or Posix, but never both, right?
I tried to explain in the comment. The actual need is in GDB when we debug
on linux a binary cross-compiled on windows. GDB does not know what form do
the paths have and should not make assumptions that they will be POSIX or
DOS (IS_ABSOLUTE_PATH will 'recognize' either POSIX or DOS path depending on
the configured host, but not both).
>
> A minor nit: your ChangeLog entry
>
> 2008-01-04 Aleksandar Ristovski <aristovski@qnx.com>
>
> * filenames.h (IS_DIR_SEPARATOR_DOS): New macro.
> (IS_ABSOLUTE_PATH_DOS): New macro.
> (IS_DIR_SEPARATOR_X): New macro.
> (IS_ABSOLUTE_PATH_X): New macro.
> (IS_DIR_SEPARATOR_ANY): New macro.
> (IS_ABSOLUTE_PATH_ANY): New macro.
>
> has two problems:
>
> . It uses leading spaces instead of a single TAB (maybe due to your
> mailer's munging of whitespace).
>
> . You could rewrite it as a much more compact single entry:
>
> 2008-01-04 Aleksandar Ristovski <aristovski@qnx.com>
>
> * filenames.h (IS_DIR_SEPARATOR_DOS, IS_ABSOLUTE_PATH_DOS)
> (IS_DIR_SEPARATOR_X, IS_ABSOLUTE_PATH_X, IS_DIR_SEPARATOR_ANY)
> (IS_ABSOLUTE_PATH_ANY): New macros.
Ok, thanks.