9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: forsyth@terzarima.net (Charles Forsyth)
Subject: [9fans] native library: linking err
Date: Mon, 14 Mar 2011 18:33:44 +0000	[thread overview]
Message-ID: <f29f8a47d46e81687e50ed0417a3f7ef@terzarima.net> (raw)
In-Reply-To: <AANLkTin8ZVrBJYDf_RiZrBctHbjugM5_OfhMkywSGFWo@mail.gmail.com>

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.



  parent reply	other threads:[~2011-03-14 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 13:52 Peter A. Cejchan
2011-03-14  9:01 ` Peter A. Cejchan
2011-03-14  9:33   ` Charles Forsyth
2011-03-14 10:19     ` Peter A. Cejchan
2011-03-14 10:42       ` Peter A. Cejchan
2011-03-14 11:48         ` Lucio De Re
2011-03-14 14:12           ` Peter A. Cejchan
2011-03-14 18:33       ` Charles Forsyth [this message]
2011-03-15  7:56         ` Peter A. Cejchan
2011-03-15  8:50           ` Steve Simon
2011-03-15  9:11             ` Peter A. Cejchan
2011-03-15  9:25             ` Peter A. Cejchan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f29f8a47d46e81687e50ed0417a3f7ef@terzarima.net \
    --to=forsyth@terzarima.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).