From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 1 Apr 2005 23:06:14 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] OT: programming style under Plan9?? In-Reply-To: <5ef017b602f99114e817ac37589aef3d@coraid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <5ef017b602f99114e817ac37589aef3d@coraid.com> Topicbox-Message-UUID: 3163fc18-ead0-11e9-9d60-3106f5b1d025 > 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 %