On 5 August 2016 at 07:46, Markus Armbruster <[email protected]> wrote:
> For me, this is one of those pointless UBs, whose only effect on the
> real world is wasting programmer time. Seriously, what else could a
> sane memset(NULL, 0, 0) do?
Since the function call is annotated in the system headers
to indicate that the first argument isn't NULL, it gives
the compiler more information which it can then use to
delete clearly-never-reachable "if (foo == NULL) { ... }"
codepaths for you :-)
thanks
-- PMM