summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-12-31 08:15:34 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-02 16:39:13 +0000
commitb42080cbe9f11cf42c1ee8ec7d264a4b7ef969d8 (patch)
treece84f86457af053495a27bcb5104d16536e1f12c /meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
parent1cecfd0332fc8b4fc1cf691e0fe4cf9849663f22 (diff)
downloadpoky-b42080cbe9f11cf42c1ee8ec7d264a4b7ef969d8.tar.gz
nfs-utils: Drop unneeded patches, cmdline option overrides
0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch is no longer needed disabling format warnings is no longer needed as well therefore remove it from recipe and address the warnings (if any in patches) Ensure that it can build with clang as well on the way via the new clang-warnings.patch patch (From OE-Core rev: c22726425a2554a65b17a9daac9350940b2ddd6b) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
new file mode 100644
index 0000000000..20400fef67
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
@@ -0,0 +1,61 @@
1Detect warning options during configure
2
3Certain options maybe compiler specific therefore its better
4to detect them before use.
5
6nfs_error copies the format string and appends newline to it
7but compiler can forget that it was format string since its not
8same fmt string that was passed. Ignore the warning
9
10Wdiscarded-qualifiers is gcc specific and this is no longer needed
11
12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15--- a/configure.ac
16+++ b/configure.ac
17@@ -599,7 +599,6 @@ my_am_cflags="\
18 -Werror=parentheses \
19 -Werror=aggregate-return \
20 -Werror=unused-result \
21- -Wno-cast-function-type \
22 -fno-strict-aliasing \
23 "
24
25@@ -619,9 +618,10 @@ CHECK_CCSUPPORT([-Werror=format-overflow
26 CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
27 CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3])
28 CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4])
29+CHECK_CCSUPPORT([-Wno-cast-function-type], [flg5])
30 AX_GCC_FUNC_ATTRIBUTE([format])
31
32-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"])
33+AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4 $flg5"])
34
35 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
36 AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
37--- a/support/nfs/xcommon.c
38+++ b/support/nfs/xcommon.c
39@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
40
41 fmt2 = xstrconcat2 (fmt, "\n");
42 va_start (args, fmt);
43+#pragma GCC diagnostic push
44+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
45 vfprintf (stderr, fmt2, args);
46+#pragma GCC diagnostic pop
47 va_end (args);
48 free (fmt2);
49 }
50--- a/utils/mount/stropts.c
51+++ b/utils/mount/stropts.c
52@@ -1094,9 +1094,7 @@ static int nfsmount_fg(struct nfsmount_i
53 if (nfs_try_mount(mi))
54 return EX_SUCCESS;
55
56-#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
57 if (errno == EBUSY && is_mountpoint(mi->node)) {
58-#pragma GCC diagnostic warning "-Wdiscarded-qualifiers"
59 /*
60 * EBUSY can happen when mounting a filesystem that
61 * is already mounted or when the context= are