[Bug middle-end/68767] spurious warning: null argument where non-null required

amylaar at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 9 17:20:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68767

--- Comment #3 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #2)
> I don't understand. It is indeed passing NULL to a non-null function. What
> is wrong with the warning?

When you look at the original testcase closely, you'll see that it can never
(unless there is a race condition, invoking undefined behaviour) pass NULL.
In fact, it always passes "lstr" .

The the reduced testcase from comment #1 is more ambiguous.  If it can or can
not pass NULL depends on values that the variable might attain.


More information about the Gcc-bugs mailing list