
On 2011-07-02 16:16, Jon Cruz wrote:
... Oh, and the point of this whole story (aside from getting our bug fixed) is to say that we *really* do not want to suppress warnings such as these. Instead we need to figure them out and get them fixed. And if it turns out to be the tool in error, we can also get that fixed since it is an open source compiler.
Don't worry, I wasn't about to suggest suppressing warnings, but rather telling clang/scan-build what our intention is. In the particular case I was talking about it would be extremely weird to call that function with a null pointer, so if we do that anywhere I want to know about it. So I do not want to supress the warning, quite the contrary, I want it to show up somewhere else.
Put differently, suppose this particular function would have been a member function (and in this particular case it perhaps should be, but that's another story), then you'd want the possible null-pointer dereference to show up where the function is called, not inside the function.
But you are right that I misunderstood what was happening, and that it is indeed the macro that is the culprit. Very good catch.