From mboxrd@z Thu Jan 1 00:00:00 1970 From: forsyth@terzarima.net (Charles Forsyth) Date: Mon, 14 Mar 2011 18:33:44 +0000 Subject: [9fans] native library: linking err In-Reply-To: Message-ID: Topicbox-Message-UUID: bb299c0e-ead6-11e9-9d60-3106f5b1d025 PSDoc is fully declared in ps_util.c but not ps_list.c because only ps_util.c includes ps_intern.h which provides the full declaration. in ps_list.h, DLIST refers to PSDoc in the declarations of DLIST.malloc and DLIST.free, so the type of DLIST in ps_list.c (ps_list.8) is not the same as the type of DLIST in ps_util.c (ps_util.8), and that in turn is reflected in the type of functions taking DLIST as a parameter type. Ideally, you'd include ps_intern.h in ps_list.c but the type system in this library is such a mess, because the modularity is really pseudo-modularity (ps_intern.h needs "ght_hash_table.h" and probably others as well). Really they should just declare everything the library needs in one file. You can hack round it by adding #pragma incomplete PSDoc to pslib.h, after the typedef declaring PSDoc. It's not correct, because PSDoc isn't really an incomplete (opaque) type, but the structure is so messed up it's probably not worth fussing over it.