简体   繁体   中英

The left operand of '&' is a garbage value

I wouldn't normally paste an image, I would provide the code as text, but I felt that the analyzer warnings where important.

I'm not sure what this means and how to fix the problems.

在此输入图像描述

The full code can be found here https://github.com/robbiehanson/CocoaHTTPServer/blob/master/Core/Categories/DDData.m

Typically you can expand the warning in the sidebar to get a detailed list of the control flow that leads to this situation. In your case, the static analyzer is saying that, given a certain set of circumstances, that line of code will execute where inbuf[1] has never been initialized to a value, and thus is garbage.

I would guess that the circumstances are if ch == '=' , this will set flendtext to YES , which will set ixinbuf to 3 , which means that inbuf[x] for x == 0-2 will never be initialized, and the subsequent access of these values is garbage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM