Fix const qualifier error
Subsystems (2)
PATCH 1/1 Fix const qualifier error
From: Wang Mingyu <[email protected]>
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;
| ^
--- support/nsm/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
support/nsm/file.c +1 -1
@@ -197,7 +197,7 @@ nsm_make_temp_pathname(const char *pathname) base =strrchr (pathname,'/' );if (base ==NULL ) - base = pathname; + base = (char *)(&pathname);else base++;
Signature · 1 line
2.43.0
Quoted 1 line · On 12/19/24 3:42 AM, [email protected] wrote:
From: Wang Mingyu <[email protected]>
Committed... (tag: nfs-utils-2-8-3-rc1)
steved.
Quoted 26 lines
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.ofile.cfile.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 <[email protected]>--- support/nsm/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/nsm/file.c +1
-1@@ -197,7 +197,7 @@ nsm_make_temp_pathname(const char *pathname) base =strrchr (pathname,'/' );if (base ==NULL ) - base = pathname; + base = (char *)(&pathname);else base++;
Quoted 1 line · On 12/19/24 3:42 AM, [email protected] wrote:
From: Wang Mingyu <[email protected]>
Committed... (tag: nfs-utils-2-8-3-rc1)
steved.
Quoted 26 lines
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.ofile.cfile.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 <[email protected]>--- support/nsm/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/nsm/file.c +1
-1@@ -197,7 +197,7 @@ nsm_make_temp_pathname(const char *pathname) base =strrchr (pathname,'/' );if (base ==NULL ) - base = pathname; + base = (char *)(&pathname);else base++;