I have removed the use of PETSC_NULL from all PETSc C code. Please remember to just use NULL in PETSc source code in the future (or Karl's script will find you).
I see you changed to
#define PETSC_IGNORE NULL
but kept
#define PETSC_NULL 0
Should the second be updated to
#define PETSC_NULL NULL
because it is stricter about passing PETSC_NULL for an integer argument?
Also, we could do something like this (properly guarded, of course):
which can be used for any compiler that supports non-static statements in declarations (everything but Sun and MSVC?) and has __attribute__((deprecated)). This produces warnings like this under Clang
ex5.c:102:36: warning: 'PETSC_NULL_IS_DEPRECATED_JUST_USE_NULL' is deprecated [-Wdeprecated-declarations]
ex5.c:102:3: warning: ‘PETSC_NULL_IS_DEPRECATED_JUST_USE_NULL’ is deprecated (declared at /home/jed/petsc/include/petscsys.h:385) [-Wdeprecated-declarations]
We can make the error message cleaner (but more confusing) with
__attribute__((deprecated))
PETSC_UNUSED static inline void PETSC_NULL() {};
#define PETSC_NULL (PETSC_NULL(),NULL)
which produces:
ex5.c: In function ‘main’:
ex5.c:102:3: warning: ‘PETSC_NULL’ is deprecated (declared at /home/jed/petsc/include/petscsys.h:385) [-Wdeprecated-declarations]