diff mbox series

Fix const qualifier error

Message ID 1734597765-2780-1-git-send-email-wangmy@fujitsu.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Fix const qualifier error | expand

Commit Message

wangmy@fujitsu.com Dec. 19, 2024, 8:42 a.m. UTC
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 mbox series

Patch

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++;