svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi

Conrad Meyer cem at freebsd.org
Sat Dec 3 20:35:24 UTC 2016


On Fri, Dec 2, 2016 at 9:38 PM, Ravi Pokala <rpokala at mac.com> wrote:
> -----Original Message-----
>> From: <owner-src-committers at freebsd.org> on behalf of Kyle Evans <kevans91 at 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 timestamp() go through report_timestamp(), not all paths through report_timestamp() set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the request was not completed, report_timestamp() does 'goto bailout' without setting *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 was 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


More information about the svn-src-all mailing list