* [PATCH] include libgen.h for basename API prototype
@ 2024-03-25 17:09 Khem Raj
2024-03-26 0:15 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2024-03-25 17:09 UTC (permalink / raw)
To: linux-xfs; +Cc: Khem Raj
basename prototype has been removed from string.h from latest musl [1]
compilers e.g. clang-18 flags the absense of prototype as error. therefore
include libgen.h for providing it.
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
common/main.c | 1 +
invutil/invidx.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/common/main.c b/common/main.c
index 1db07d4..ca3b7d4 100644
--- a/common/main.c
+++ b/common/main.c
@@ -16,6 +16,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <libgen.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 5874e8d..c4e2e21 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -19,6 +19,7 @@
#include <xfs/xfs.h>
#include <xfs/jdm.h>
+#include <libgen.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] include libgen.h for basename API prototype
2024-03-25 17:09 [PATCH] include libgen.h for basename API prototype Khem Raj
@ 2024-03-26 0:15 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2024-03-26 0:15 UTC (permalink / raw)
To: Khem Raj; +Cc: linux-xfs
On Mon, Mar 25, 2024 at 10:09:41AM -0700, Khem Raj wrote:
> basename prototype has been removed from string.h from latest musl [1]
> compilers e.g. clang-18 flags the absense of prototype as error. therefore
> include libgen.h for providing it.
>
> [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
The basename(3) manpage makes reference to glibc's POSIX implementation
modifying the string argument passed in. Is that going to cause
problems with the existing callsites in xfsdump?
--D
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> common/main.c | 1 +
> invutil/invidx.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/common/main.c b/common/main.c
> index 1db07d4..ca3b7d4 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -16,6 +16,7 @@
> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <libgen.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <stdlib.h>
> diff --git a/invutil/invidx.c b/invutil/invidx.c
> index 5874e8d..c4e2e21 100644
> --- a/invutil/invidx.c
> +++ b/invutil/invidx.c
> @@ -19,6 +19,7 @@
> #include <xfs/xfs.h>
> #include <xfs/jdm.h>
>
> +#include <libgen.h>
> #include <stdio.h>
> #include <fcntl.h>
> #include <unistd.h>
> --
> 2.44.0
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-26 0:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 17:09 [PATCH] include libgen.h for basename API prototype Khem Raj
2024-03-26 0:15 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox