PetscSafePointerPlusOffset#

Checks that a pointer is not NULL before applying an offset

Note#

This is needed to avoid errors with undefined-behavior sanitizers such as UBSan, assuming PETSc has been configured with -fsanitize=undefined as part of the compiler flags

See Also#

PetscInitialize()

Level#

beginner

Location#

include/petscsys.h

Examples#

src/dm/dt/tests/ex7.c
src/dm/impls/plex/tests/ex8.c
src/vec/is/sf/tests/ex5.c


Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages