Using gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) $ cat declared-struct.c #include <sys/sdt.h> struct foo; int main() { struct foo* p = 0; STAP_PROBE1(test, foo, p); return 0; } $ gcc -c declared-struct.c declared-struct.c: In function ‘main’: declared-struct.c:6: error: invalid use of undefined type ‘struct foo’ declared-struct.c:6: error: invalid use of undefined type ‘struct foo’ declared-struct.c:6: error: invalid use of undefined type ‘struct foo’ declared-struct.c:6: error: invalid use of undefined type ‘struct foo’ I think it's complaining about the "+ 0" math on the argument. If I cast "p" to a void*, it compiles fine.
(In reply to comment #0) > If I cast "p" to a void*, it compiles fine. ... unless we're -pedantic, and then: $ gcc -c declared-struct.c -pedantic declared-struct.c: In function ‘main’: declared-struct.c:6: warning: pointer of type ‘void *’ used in arithmetic declared-struct.c:6: warning: pointer of type ‘void *’ used in arithmetic declared-struct.c:6: warning: pointer of type ‘void *’ used in arithmetic declared-struct.c:6: warning: pointer of type ‘void *’ used in arithmetic When cast as char*, int*, etc., it works even with -pedantic.
The sdt.h shipped with 1.4 works fine.