This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH[libiberty] for Re: Mainline: C++ include files not found!


> My initial reluctance was that readlink isn't guaranteed to give us
> something that we can append to the dirname and access.  And I'd
> need to drag in both stat and readlink, and some bits for
> HOST_EXECUTABLE_SUFFIX that I'm not entirely sure of.

I had at one point written a semi-portable canonicalize_file_name()
that did all that, but the reason I wrote it went away, so I dropped
it.

> Would you rather I add this, or can we leave it until someone needs
> this on DJGPP?

It will work well enough on DJGPP without it, so I wouldn't bother.

> Optionally returning filename seems risky to me, personally.

I'm thinking that most uses of this function will call it once at
program startup and not even need to free the malloc'd pointer.  I
guess it doesn't matter either way.

> You've got a good point on the xmalloc thing.  How about use malloc
> and return NULL on allocation failure?  And strdup instead of
> xstrdup.

That would be better.


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