poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug Other/26981] New: missing include for 'basename'


From: comexk at gmail dot com
Subject: [Bug Other/26981] New: missing include for 'basename'
Date: Mon, 30 Nov 2020 06:24:04 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26981

            Bug ID: 26981
           Summary: missing include for 'basename'
           Product: poke
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: Other
          Assignee: unassigned at sourceware dot org
          Reporter: comexk at gmail dot com
                CC: poke-devel at gnu dot org
  Target Milestone: ---

One more portability issue :)

When building poke/pk-cmd-def.c on macOS, the function `basename` is not
declared.

This should probably be fixed by adding the `dirname` module from gnulib. 
(Watch out - that module declares the function as `base_name` rather than
`basename`.)

An alternative is to include <libgen.h> to get the POSIX version of basename. 
However, according to the glibc manual, the `basename` you get from <libgen.h>
is different from the glibc-specific one you get from <string.h>.  It accepts a
non-const char *, and can modify it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]