From: Arjun Shankar <arjun@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: Arjun Shankar <arjun@redhat.com>
Subject: [PATCH] Remove several implicit function declarations
Date: Wed, 8 Feb 2023 10:43:33 +0100 [thread overview]
Message-ID: <20230208094333.364705-1-arjun@redhat.com> (raw)
During configure, several ioctl checks omit the correspondig include
and a pwritev2 check uses the wrong feature test macro. Also,
scrub/unicrash.c omits the appropriate include for u_init/u_cleanup.
All of the above lead to implicit function declarations at build time.
This commit fixes the same.
Signed-off-by: Arjun Shankar <arjun@redhat.com>
---
We ran into these when trying to port Fedora to modern C:
https://fedoraproject.org/wiki/Changes/PortingToModernC
https://fedoraproject.org/wiki/Toolchain/PortingToModernC
---
m4/package_libcdev.m4 | 7 +++++--
scrub/unicrash.c | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index bb1ab49c..f987aa4a 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -117,6 +117,7 @@ AC_DEFUN([AC_HAVE_FIEMAP],
#define _GNU_SOURCE
#include <linux/fs.h>
#include <linux/fiemap.h>
+#include <sys/ioctl.h>
]], [[
struct fiemap *fiemap;
ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
@@ -153,7 +154,7 @@ AC_DEFUN([AC_HAVE_PWRITEV2],
[ AC_MSG_CHECKING([for pwritev2])
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[
-#define _BSD_SOURCE
+#define _GNU_SOURCE
#include <sys/uio.h>
]], [[
pwritev2(0, 0, 0, 0, 0);
@@ -454,6 +455,7 @@ AC_DEFUN([AC_HAVE_SG_IO],
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <scsi/sg.h>
+#include <sys/ioctl.h>
]], [[
struct sg_io_hdr hdr;
ioctl(0, SG_IO, &hdr);
@@ -471,7 +473,8 @@ AC_DEFUN([AC_HAVE_HDIO_GETGEO],
[ AC_MSG_CHECKING([for struct hd_geometry ])
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
-#include <linux/hdreg.h>,
+#include <linux/hdreg.h>
+#include <sys/ioctl.h>
]], [[
struct hd_geometry hdr;
ioctl(0, HDIO_GETGEO, &hdr);
diff --git a/scrub/unicrash.c b/scrub/unicrash.c
index 24d4ea58..c645fc73 100644
--- a/scrub/unicrash.c
+++ b/scrub/unicrash.c
@@ -14,6 +14,7 @@
#include <unicode/ustring.h>
#include <unicode/unorm2.h>
#include <unicode/uspoof.h>
+#include <unicode/uclean.h>
#include "libfrog/paths.h"
#include "xfs_scrub.h"
#include "common.h"
--
2.38.1
next reply other threads:[~2023-02-08 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 9:43 Arjun Shankar [this message]
2023-02-14 8:16 ` [PATCH] Remove several implicit function declarations Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230208094333.364705-1-arjun@redhat.com \
--to=arjun@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox