|
From: Bryan O'S. <bo...@se...> - 2004-09-28 18:49:44
|
On Tue, 2004-09-28 at 10:46 -0700, Daniel Miller (IMI) wrote: > Okay, I added > char xbuf = 0 ; > to the beginning of get_number_of_luns(). I understand now that valgrind > doesn't realize that xbuf will be initialized unless usb_control_msg() > returned negative value, and in either case get_number_of_luns() will return > a valid value. So I'll have to add unnecessary initialization code to quiet > valgrind, tho it isn't needed by the actual application. Why do you think get_number_of_luns is returning a valid value in xbuf? It is quite possible that it is not. Since I assuming you're using libusb, you should check the source and find out. > Are there some kind of conditional compile flags that I can use to remove > such code when I'm not going to run valgrind (similar to the #ifdef _lint > for lint), so I don't always have this extra code installed? Yes, you can use #ifdef NVALGRIND. However, if you're talking about setting a char value to zero, there's no reason to avoid it. <b |