libsvm icon indicating copy to clipboard operation
libsvm copied to clipboard

Useless assignment found by static analyzer?

Open QiAnXinCodeSafe opened this issue 6 years ago • 2 comments

Hi all, This is Qihoo360 CodeSafe Team, we found a useless assignment in libsvm, see https://github.com/cjlin1/libsvm/blob/88a1881f03ca139beff93170d7e6f36477fabe54/svm.cpp#L2932. The return value of strtok(line, ":") assigned to p, and this value is never read!

This is not a fatal issue, and I can't provide a perfect fix for that!

Could you help me confirm this, @cjlin1!

Thanks in advance!

QiAnXinCodeSafe avatar Jul 13 '18 02:07 QiAnXinCodeSafe

Yes, for that assignment the returned value is not used. But I guess it's ok to leave that there.

360 CodeSafe writes:

Hi all, This is Qihoo360 CodeSafe Team, we found a useless assignment in libsvm, see https://github.com/cjlin1/libsvm/blob/88a1881f03ca139beff93170d7e6f36477fabe54/svm.cpp#L2932 . The return value of strtok(line, ":") assigned to p, and this value is never read!

This is not a fatal issue, and I can't provide a perfect fix for that!

Could you help me confirm this, @cjlin1!

Thanks in advance!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.*

cjlin1 avatar Jul 14 '18 12:07 cjlin1

@cjlin1 Hmm, you are right, it is not an issue that worth the effort to fix for now.

QiAnXinCodeSafe avatar Jul 16 '18 05:07 QiAnXinCodeSafe