Gentoo Archives: eudev

From: Marcus Folkesson <marcus.folkesson@×××××.com>
To: "Anthony G. Basile" <basile@××××××××××.net>
Cc: eudev@l.g.o
Subject: Re: [eudev] [PATCH 1/3] shared: typecast away 'const' qualifier from pointer
Date: Mon, 19 Feb 2018 06:20:20
Message-Id: 20180219062013.GA17369@gmail.com
In Reply to: Re: [eudev] [PATCH 1/3] shared: typecast away 'const' qualifier from pointer by "Anthony G. Basile"
1 On Sun, Feb 18, 2018 at 09:58:19PM -0500, Anthony G. Basile wrote:
2 > On 2/18/18 2:47 PM, Marcus Folkesson wrote:
3 > > Get rid of this warning:
4 > > warning: passing argument 1 of ‘__xpg_basename’ discards ‘const’
5 > > qualifier from pointer target type [-Wdiscarded-qualifiers]
6 > > fn = basename(p);
7 > >
8 > > Signed-off-by: Marcus Folkesson <marcus.folkesson@×××××.com>
9 > > ---
10 > > src/shared/util.c | 2 +-
11 > > 1 file changed, 1 insertion(+), 1 deletion(-)
12 > >
13 > > diff --git a/src/shared/util.c b/src/shared/util.c
14 > > index ac69ae80e..9e36050a0 100644
15 > > --- a/src/shared/util.c
16 > > +++ b/src/shared/util.c
17 > > @@ -1726,7 +1726,7 @@ int tempfn_xxxxxx(const char *p, char **ret) {
18 > > * /foo/bar/.#waldoXXXXXX
19 > > */
20 > >
21 > > - fn = basename(p);
22 > > + fn = basename((char*)p);
23 > > if (!filename_is_valid(fn))
24 > > return -EINVAL;
25 > >
26 >
27 >
28 > This fix is already in there.
29
30 You are right, my git-fu seems to have degraded yesterday.
31
32 It is not the first time I create a local branch called "origin/master"
33 by mistake.
34 Seems like I have done it for my systemd repo too.
35
36 I thought this warning was familiar...
37
38 >
39 > --
40 > Anthony G. Basile, Ph.D.
41 > Gentoo Linux Developer [Hardened]
42 > E-Mail : basile@××××××××××.net
43 > GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
44 > GnuPG ID : F52D4BBA
45 >
46 >

Attachments

File name MIME type
signature.asc application/pgp-signature