9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] OT: programming style under Plan9??
Date: Fri,  1 Apr 2005 23:06:14 -0500	[thread overview]
Message-ID: <ee9e417a05040120067a3b7600@mail.gmail.com> (raw)
In-Reply-To: <5ef017b602f99114e817ac37589aef3d@coraid.com>

> I would make the remark that C doesn't have modules.  After
> compiling the code type information is lost and you can link
> to anything that will resolve a name.  For example I can treat
> the name qsort(3) as an array of integers.  The loader will resolve
> the name qsort and the code in main will just do what I told it to.

now fixed on plan 9:

% cat x.c
#pragma lib "libc.a"

extern int qsort[];
extern int print(char*, ...);

void
main(void)
{
	int i;

	for(i=0; i<10; i++)
		print("%08ux\n", qsort[i]);
}
% 8c -T x.c
% 8l x.8
qsorts: incompatible type signatures b3a1d3d5(x.8) and
c7dcac09(/386/lib/libc.a(qsort)) for qsort
%


  reply	other threads:[~2005-04-02  4:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-02  1:34 I RATTAN
2005-04-02  2:40 ` Ronald G. Minnich
2005-04-02  3:34 ` Brantley Coile
2005-04-02  4:06   ` Russ Cox [this message]
2005-04-04  9:56     ` Gorka Guardiola
2005-04-04 13:24       ` jmk
2005-04-04 14:20         ` Charles Forsyth
2005-04-02  9:31   ` Charles Forsyth
2005-04-02  9:56     ` noselasd
2005-04-02 19:31       ` jmk
2005-04-02 20:57         ` Devon H. O'Dell 
2005-04-02 22:08           ` jmk
2005-04-02 12:36     ` Brantley Coile
2005-04-02  3:54 ` Russ Cox
2005-04-02 13:11   ` I RATTAN
2005-04-02 15:50     ` Ronald G. Minnich

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=ee9e417a05040120067a3b7600@mail.gmail.com \
    --to=russcox@gmail.com \
    --cc=9fans@cse.psu.edu \
    /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).