Date: Sun, 3 Jun 2018 22:15:47 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Dimitry Andric <dim@FreeBSD.org>, Rick Macklem <rmacklem@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r334586 - head/sys/fs/nfsserver Message-ID: <YTOPR0101MB095300672DD7BD8C011E5F6ADD600@YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <2231964C-8130-416D-963D-77F93DF2F08A@FreeBSD.org> References: <201806031946.w53JkiHm084473@repo.freebsd.org>, <2231964C-8130-416D-963D-77F93DF2F08A@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Dimitry Andric wrote: >On 3 Jun 2018, at 21:46, Rick Macklem <rmacklem@FreeBSD.org> wrote: >> >> Author: rmacklem >> Date: Sun Jun 3 19:46:44 2018 >> New Revision: 334586 >> URL: https://svnweb.freebsd.org/changeset/base/334586 >> >> Log: >> Fix a gcc8 warning about a write only variable. >> >> gcc8 warns that "verf" was set but not used. This was because the code >> that uses it is disabled via a "#if 0". >> This patch adds a "#if 0" to the variable's declaration and assignment >> to get rid of the warning. >> This way the code could be re-enabled without difficulty. >> >> Requested by: mmacy >> MFC after: 2 weeks >> >> Modified: >> head/sys/fs/nfsserver/nfs_nfsdport.c >> >> Modified: head/sys/fs/nfsserver/nfs_nfsdport.c >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=3D=3D=3D= =3D=3D=3D=3D=3D=3D >> --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:37:17 2018 = (r334585) >> +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:46:44 2018 = >(r334586) >> @@ -1574,7 +1574,10 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isd= gram, >> struct nfsvattr at; >> int nlen, error =3D 0, getret =3D 1; >> int siz, cnt, fullsiz, eofflag, ncookies; >> - u_int64_t off, toff, verf; >> + u_int64_t off, toff; >> +#if 0 >> + u_int64_t verf; >> +#endif >> u_long *cookies =3D NULL, *cookiep; >> struct uio io; >> struct iovec iv; >> @@ -1591,7 +1594,9 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdg= ram, >> NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); >> off =3D fxdr_hyper(tl); >> tl +=3D 2; >> +#if 0 >> verf =3D fxdr_hyper(tl); >> +#endif > >This functionally changes the code, though. Is fxdr_hyper() no longer >supposed to be called? It's not a problem. fxdr_hyper() is a "pure function with no side effects" = and just returns the translated value. It translates a 64bit number from XDR fo= rmat (big endian) to native architecture format. (The argument is a ptr to where= the value is in XDR. (Stands for eXternal Data Representation. A Sun thing from= the mid 1980s.) rick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTOPR0101MB095300672DD7BD8C011E5F6ADD600>