Gentoo Archives: gentoo-commits

From: "Jakov Smolić" <jsmolic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/bmake/, sys-devel/bmake/files/
Date: Wed, 27 Apr 2022 21:09:42
Message-Id: 1651093768.32fd2d327a841841a0aa1440994fd072eb7973b1.jsmolic@gentoo
1 commit: 32fd2d327a841841a0aa1440994fd072eb7973b1
2 Author: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 27 21:09:17 2022 +0000
4 Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 27 21:09:28 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32fd2d32
7
8 sys-devel/bmake: Fix compilation warnings
9
10 Closes: https://bugs.gentoo.org/841362
11 Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
12
13 sys-devel/bmake/bmake-20220418.ebuild | 5 ++-
14 .../bmake/files/bmake-20220418-warnings.patch | 38 ++++++++++++++++++++++
15 2 files changed, 42 insertions(+), 1 deletion(-)
16
17 diff --git a/sys-devel/bmake/bmake-20220418.ebuild b/sys-devel/bmake/bmake-20220418.ebuild
18 index 7b11aa7cebf4..5505e007c65a 100644
19 --- a/sys-devel/bmake/bmake-20220418.ebuild
20 +++ b/sys-devel/bmake/bmake-20220418.ebuild
21 @@ -17,7 +17,10 @@ SLOT="0"
22 KEYWORDS="~amd64 ~ppc ~x86"
23
24 # Skip failing test (sandbox and csh)
25 -PATCHES=( "${FILESDIR}"/${PN}-20210206-tests.patch )
26 +PATCHES=(
27 + "${FILESDIR}"/${PN}-20210206-tests.patch
28 + "${FILESDIR}"/${PN}-20220418-warnings.patch
29 +)
30
31 src_prepare() {
32 default
33
34 diff --git a/sys-devel/bmake/files/bmake-20220418-warnings.patch b/sys-devel/bmake/files/bmake-20220418-warnings.patch
35 new file mode 100644
36 index 000000000000..1fccb91e95a3
37 --- /dev/null
38 +++ b/sys-devel/bmake/files/bmake-20220418-warnings.patch
39 @@ -0,0 +1,38 @@
40 +# https://bugs.gentoo.org/841362
41 +#
42 +# Fix -Wimplicit-function-declaration and -Wunused-result warnings
43 +#
44 +# meta.c: In function ‘meta_name’:
45 +# meta.c:262:21: warning: implicit declaration of function ‘strlcpy’; did you mean ‘strncpy’? [-Wimplicit-function-declaration]
46 +# 262 | strlcpy(rp, tname_base, sizeof buf - (size_t)(rp - buf));
47 +# | ^~~~~~~
48 +# | strncpy
49 +#
50 +# meta.c: In function ‘meta_job_error’:
51 +# meta.c:774:5: warning: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
52 +# 774 | getcwd(cwd, sizeof cwd);
53 +# | ^~~~~~~~~~~~~~~~~~~~~~~
54 +
55 +--- a/meta.c
56 ++++ b/meta.c
57 +@@ -106,6 +106,10 @@
58 + char * stresep(char **, const char *, int);
59 + #endif
60 +
61 ++#if !defined(HAVE_STRLCPY)
62 ++size_t strlcpy(char *, const char *, size_t);
63 ++#endif
64 ++
65 + /*
66 + * Filemon is a kernel module which snoops certain syscalls.
67 + *
68 +@@ -769,7 +773,8 @@
69 + }
70 + if (gn != NULL)
71 + Global_Set(".ERROR_TARGET", GNode_Path(gn));
72 +- getcwd(cwd, sizeof cwd);
73 ++ if (getcwd(cwd, sizeof cwd) == NULL)
74 ++ err(1, "Could not get current working directory");
75 + Global_Set(".ERROR_CWD", cwd);
76 + if (pbm->meta_fname[0] != '\0') {
77 + Global_Set(".ERROR_META_FILE", pbm->meta_fname);