public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: wangmy@fujitsu.com
To: Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org, Wang Mingyu <wangmy@cn.fujitsu.com>
Subject: [PATCH] Fix const qualifier error
Date: Thu, 19 Dec 2024 16:42:45 +0800	[thread overview]
Message-ID: <1734597765-2780-1-git-send-email-wangmy@fujitsu.com> (raw)

From: Wang Mingyu <wangmy@cn.fujitsu.com>

erroe message:
cc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc  -I/usr/include/libxml2  -D_GNU_SOURCE -pipe  -Wall  -Wextra  -Werror=strict-prototypes  -Werror=missing-prototypes  -Werror=missing-declarations  -Werror=format=2  -Werror=undef  -Werror=missing-include-dirs  -Werror=strict-aliasing=2  -Werror=init-self  -Werror=implicit-function-declaration  -Werror=return-type  -Werror=switch  -Werror=overflow  -Werror=parentheses  -Werror=aggregate-return  -Werror=unused-result  -fno-strict-aliasing  -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -MT file.o -MD -MP -MF .deps/file.Tpo -c -o file.o file.c
file.c: In function ‘nsm_make_temp_pathname’:
file.c:200:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  200 |                 base = pathname;
      |                      ^

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 support/nsm/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/nsm/file.c b/support/nsm/file.c
index de122b0f..27332108 100644
--- a/support/nsm/file.c
+++ b/support/nsm/file.c
@@ -197,7 +197,7 @@ nsm_make_temp_pathname(const char *pathname)
 
 	base = strrchr(pathname, '/');
 	if (base == NULL)
-		base = pathname;
+		base = (char*)(&pathname);
 	else
 		base++;
 
-- 
2.43.0


             reply	other threads:[~2024-12-19  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  8:42 wangmy [this message]
2025-01-03 21:31 ` [PATCH] Fix const qualifier error Steve Dickson
2025-01-03 21:32 ` Steve Dickson

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=1734597765-2780-1-git-send-email-wangmy@fujitsu.com \
    --to=wangmy@fujitsu.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    --cc=wangmy@cn.fujitsu.com \
    /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