Page MenuHomeFreeBSD

Replace local prototype of basename() with an inclusion of <libgen.h>.
ClosedPublic

Authored by ed on May 29 2016, 3:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 11 2023, 9:29 AM
Unknown Object (File)
Sep 29 2023, 6:22 PM
Unknown Object (File)
Sep 22 2023, 7:48 AM
Unknown Object (File)
Aug 20 2023, 6:56 PM
Unknown Object (File)
Aug 2 2023, 8:12 AM
Unknown Object (File)
Jul 1 2023, 6:41 AM
Unknown Object (File)
Jun 27 2023, 9:08 AM
Unknown Object (File)
Jun 16 2023, 9:39 AM
Subscribers

Details

Summary

libiberty currently defines the prototype for basename() itself instead
of using <libgen.h>. It still uses the BSD-style prototype instead of
the POSIX one, meaning that if FreeBSD would switch over to the POSIX
one, you wouldn't be able to use libiberty.h and libgen.h in a single
source file. It turns out that kgdb does this. Patch up libiberty to
just include <libgen.h>.

I'm currently talking to upstream to see whether we can come up with a
more complete solution that could be integrated, but for our
unmaintained copy of GDB in base, let's just apply the simplest
workaround possible.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Replace local prototype of basename() with an inclusion of <libgen.h>..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added a reviewer: pfg.
pfg edited edge metadata.

Looks good to me, although it may be better to special case just FreeBSD here.

This revision is now accepted and ready to land.May 29 2016, 3:59 PM
In D6631#140071, @pfg wrote:

Looks good to me, although it may be better to special case just FreeBSD here.

This problem essentially also applies to all those other systems listed there. They should all have a libgen.h that provides a prototype for basename().

In D6631#140076, @ed wrote:
In D6631#140071, @pfg wrote:

Looks good to me, although it may be better to special case just FreeBSD here.

This problem essentially also applies to all those other systems listed there. They should all have a libgen.h that provides a prototype for basename().

I was thinking mostly of not diverging too much from upstream, since this is contributed, although basically not maintained, code.
Still the change is fine as is.

In D6631#140081, @pfg wrote:
In D6631#140076, @ed wrote:
In D6631#140071, @pfg wrote:

Looks good to me, although it may be better to special case just FreeBSD here.

This problem essentially also applies to all those other systems listed there. They should all have a libgen.h that provides a prototype for basename().

I was thinking mostly of not diverging too much from upstream, since this is contributed, although basically not maintained, code.
Still the change is fine as is.

Cool. If upstream ends up submitting a small fix for the same issue, I'll revert this one and replace it by the one from upstream.

This revision was automatically updated to reflect the committed changes.