[mythtv] Null pointer dereference warnings when compiling with -O3

David Engel david at istwok.net
Thu Sep 24 16:27:17 UTC 2020


On Thu, Sep 24, 2020 at 11:34:34AM -0400, David Hampton wrote:
> If there was a way to embed into the source code the a priori knowledge
> that the argument to function A will never be null, then the compiler
> shouldn't complain at all about the optimized code. Unfortunately,
> here's no way to label that function parameter in standard C++. Adding
> an actual null pointer test at the top of function A would codify that
> knowledge in a way that the compiler understands.

My understanding is that if a pointer parameter can never be null,
then that a priori knowledge can be conveyed by passing a reference
instead of a pointer.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list