Date: Sat, 3 Dec 2016 12:35:21 -0800 From: Conrad Meyer <cem@freebsd.org> To: Ravi Pokala <rpokala@mac.com> Cc: Kyle Evans <kevans91@ksu.edu>, "Kenneth D. Merry" <ken@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi Message-ID: <CAG6CVpVvcaYk%2BNaZ_ffGj14BUP6SDU6oVKU-Q%2B9BCr4L076PzA@mail.gmail.com> In-Reply-To: <F2FD52F5-E537-456E-B741-6F4E4FE280F5@panasas.com> References: <201612012220.uB1MKSbR054941@repo.freebsd.org> <CACNAnaHaP3esEcudefF3JvtBt5Mv2Kkyo8eRpQXd_EzBD3TvdQ@mail.gmail.com> <F2FD52F5-E537-456E-B741-6F4E4FE280F5@panasas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 2, 2016 at 9:38 PM, Ravi Pokala <rpokala@mac.com> wrote: > -----Original Message----- >> From: <owner-src-committers@freebsd.org> on behalf of Kyle Evans <kevans= 91@ksu.edu> >> >> I understand that this is a bogus error because at this point it >> pretty much *has* to be set by the report_timestamp call just prior, >> but is there a clean way to trick GCC into agreeing, or is it just a >> matter of explicitly initializing it to 0 before the report_timestamp >> call? > > Actually, it's a valid warning. While all paths to that point in timestam= p() go through report_timestamp(), not all paths through report_timestamp()= set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the requ= est was not completed, report_timestamp() does 'goto bailout' without setti= ng *ts. But in that case, report_timestamp() returns a non-zero error. And timestamp() will goto its own bailout, avoiding use of an unset value. > I'm disappointed that `clang' (on i386 and amd64) didn't notice this; I w= as under the impression `clang' did more of that type of deep path analysis= than `gcc'. <shrug> I think it's purely spurious, although understandably difficult for the compiler to notice. Adrian's proposed zero initialization seems like a fine fix. Best, Conrad
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpVvcaYk%2BNaZ_ffGj14BUP6SDU6oVKU-Q%2B9BCr4L076PzA>