You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases in the Silo C library, a pointer can be NULL (or not) and an equality comparison to NULL is used to decide whether to write the associated data the pointer references. In other cases, an associated size or count integer argument signifies whether there is data to write from the pointer and the pointer is never compared with NULL to decide to issue the write.
From Fortran, the constant DB_F77NULL (which is integer value -99) is used to indicate pointer arguments that are NULL.
For any of those cases where the pointer is of the first kind described in the first paragraph, where it is compared with NULL to decide to write it references or not, in the Fortran wrapper code, silo_f.c, we need to compare the passed argument with DB_F77NULL and either pass NULL or pass the pointer given through to the C interface.
I've encountered a few cases where we don't handle this correctly and fear there are many other lurking that I haven't had time to go investigate.
We need to audit the Fortran wrapper code, silo_f.c and find and fix any other cases. The fix is to instead of just passing the pointer (say p) to the C function, we need to pass *p==DB_F77NULL?NULL:p
The text was updated successfully, but these errors were encountered:
In some cases in the Silo C library, a pointer can be
NULL
(or not) and an equality comparison toNULL
is used to decide whether to write the associated data the pointer references. In other cases, an associated size or count integer argument signifies whether there is data to write from the pointer and the pointer is never compared withNULL
to decide to issue the write.From Fortran, the constant
DB_F77NULL
(which is integer value-99
) is used to indicate pointer arguments that areNULL
.For any of those cases where the pointer is of the first kind described in the first paragraph, where it is compared with
NULL
to decide to write it references or not, in the Fortran wrapper code,silo_f.c
, we need to compare the passed argument withDB_F77NULL
and either passNULL
or pass the pointer given through to the C interface.I've encountered a few cases where we don't handle this correctly and fear there are many other lurking that I haven't had time to go investigate.
We need to audit the Fortran wrapper code,
silo_f.c
and find and fix any other cases. The fix is to instead of just passing the pointer (sayp
) to the C function, we need to pass*p==DB_F77NULL?NULL:p
The text was updated successfully, but these errors were encountered: