The definition of libpff_item_t is compatible to libpff_record_set_t (and possibly others). This is very unfortunate, because it masks developer errors, for example when a logically different-typed thing is passed:
#include <libpff.h>
void f(libpff_record_set_t *x) {}
int main()
{
libpff_item_t *x = NULL;
f(x);
}
Observed:
Expected to see:
» gcc x.c -Wall
x.c: In function ‘main’:
x.c:11:4: warning: passing argument 1 of ‘f’ from incompatible pointer type [-Wincompatible-pointer-types]
11 | f(x);
x.c:7:29: note: expected ‘libpff_record_set_t *’ but argument is of type ‘libpff_item_t *’
The definition of
libpff_item_tis compatible tolibpff_record_set_t(and possibly others). This is very unfortunate, because it masks developer errors, for example when a logically different-typed thing is passed:Observed:
Expected to see: