This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path styles
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Aleksandar Ristovski <ARistovski at qnx dot com>
- Cc: gdb-patches at sourceware dot org, drow at false dot org, brobecker at adacore dot com, RMansfield at qnx dot com
- Date: Sat, 05 Jan 2008 16:19:00 +0200
- Subject: Re: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path styles
- References: <2F6320727174C448A52CEB63D85D11F40A4B@nova.ott.qnx.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Aleksandar Ristovski <ARistovski@qnx.com>
> Cc: Daniel Jacobowitz <drow@false.org>, Joel Brobecker <brobecker@adacore.com>, Ryan Mansfield <RMansfield@qnx.com>
> Date: Fri, 4 Jan 2008 14:02:30 -0500
>
> +#define IS_DIR_SEPARATOR_X(c) ((c) == '/')
> +#define IS_ABSOLUTE_PATH_X(c) (IS_DIR_SEPARATOR_X((f)[0]))
I think _X is not appropriate here. How about _POSIX?
> +
> +/* 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?
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.