https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106620
Bug ID: 106620 Summary: Incorrectly thinks execution can continue after a return statement Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: nrk at disroot dot org Target Milestone: --- Created attachment 53457 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53457&action=edit sample code Sample code (also attached) : https://godbolt.org/z/ez556Yd39 It thinks that memchr() is being called with null. But if `hay` was null, then the function returns, so that's not possible. Removing the `|| nlen == 1` silences the warning.