* [PATCH] Fix const qualifier error
@ 2024-12-19 8:42 wangmy
2025-01-03 21:31 ` Steve Dickson
2025-01-03 21:32 ` Steve Dickson
0 siblings, 2 replies; 3+ messages in thread
From: wangmy @ 2024-12-19 8:42 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs, Wang Mingyu
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Fix const qualifier error
2024-12-19 8:42 [PATCH] Fix const qualifier error wangmy
@ 2025-01-03 21:31 ` Steve Dickson
2025-01-03 21:32 ` Steve Dickson
1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2025-01-03 21:31 UTC (permalink / raw)
To: wangmy, Linux NFS Mailing list
On 12/19/24 3:42 AM, wangmy@fujitsu.com wrote:
> From: Wang Mingyu <wangmy@cn.fujitsu.com>
Committed... (tag: nfs-utils-2-8-3-rc1)
steved.
>
> 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++;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix const qualifier error
2024-12-19 8:42 [PATCH] Fix const qualifier error wangmy
2025-01-03 21:31 ` Steve Dickson
@ 2025-01-03 21:32 ` Steve Dickson
1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2025-01-03 21:32 UTC (permalink / raw)
To: wangmy; +Cc: linux-nfs, Wang Mingyu
On 12/19/24 3:42 AM, wangmy@fujitsu.com wrote:
> From: Wang Mingyu <wangmy@cn.fujitsu.com>
Committed... (tag: nfs-utils-2-8-3-rc1)
steved.
>
> 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++;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-03 21:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 8:42 [PATCH] Fix const qualifier error wangmy
2025-01-03 21:31 ` Steve Dickson
2025-01-03 21:32 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox