Message ID | 1734597765-2780-1-git-send-email-wangmy@fujitsu.com (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | Fix const qualifier error | expand |
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++; >
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++; >
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++;