Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiler can assume address will never be NULL error with GCC6
So, it turns out that relying on the address of something passed by reference being able to be NULL isn't exactly a good idea, or remotely obvious code. So, instead, do the sane thing and pass a pointer and check it. In constructor ?PRDF::AttnTypeRegister::AttnTypeRegister(...)?: the compiler can assume that the address of ?i_check? will never be NULL [-Werror=address] iv_check( NULL == &i_check ? &cv_null : &i_check), ~~^~~~~~~~~~~ the compiler can assume that the address of ?i_recov? will never be NULL [-Werror=address] iv_recov( NULL == &i_recov ? &cv_null : &i_recov), ~~^~~~~~~~~~~ the compiler can assume that the address of ?i_special? will never be NULL [-Werror=address] iv_special(NULL == &i_special ? &cv_null : &i_special), ~~^~~~~~~~~~~~~ the compiler can assume that the address of ?i_proccs? will never be NULL [-Werror=address] iv_proccs( NULL == &i_proccs ? &cv_null : &i_proccs), ~~^~~~~~~~~~~~ src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C:123: the compiler can assume that the address of ?r? will never be NULL [-Werror=address] PRDF_ASSERT( &r != NULL ); Change-Id: I46181487cea89c8918899bab2ab17c82b68122ee Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36899 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
- Loading branch information