This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -remap: Should we remap before / after simplification?


On Wed, Mar 14, 2001 at 07:44:14AM +0000, Neil Booth wrote:
> CPP simplifies pathnames so that, e.g., 
> 
> a/b/c/../d   -> a/b/d
> 
> internally.  Now consider what happens in the case that "a/b/c" is a
> directory with header remappings.  CPP presently looks in the remap file
> for whether a file name should be remapped, * but it looks after doing
> the path simplification above and still assumes the resulting name begins
> with a/b/c *.  In other words, in the above case, rather than looking
> for a map for "../d" it looks for a map for "" (and is lucky it isn't
> beyond the end of the string in this case).
> 
> This is obviously broken; the question is how to fix it.  It seems that
> the only sensible fix is to do filename simplification *after* remapping
> the filename.

That seems like a reasonable change to me.  Talk to the DJGPP folks,
they are the only ones who use this feature.

> The same bug is also inherently making the assumption that the mapped-to
> file will be in the same directory; I see no reason for us to demand
> that either.

I believe it's only ever used to map to files in the same directory,
but there's no reason not to allow it to go elsewhere.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]