9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] type signatures
@ 2008-01-19  0:45 erik quanstrom
  0 siblings, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2008-01-19  0:45 UTC (permalink / raw)
  To: 9fans

i added a function to 9load's lib.h today declared incorrectly.
9load uses lib.h so one doesn't haul in the entire c library by
accident. there were no link errors. it didn't crash, but did some
difficult to explain things.  now fixed.

i believe other times i've declared an extern function incorrectly
and the linker has given me diagnostics.  but when i looked at
/386/lib/libc.a, there are no type signatures and it turns out the
default is that they are not generated.

so, am i wrong that i have seen diagnostics for incompatable
type signatures?  and, why aren't the signatures put into
object files by default?

- erik


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [9fans] type signatures
@ 2009-03-02 15:23 Steve Simon
  2009-03-02 15:40 ` Fco. J. Ballesteros
  2009-03-03  0:42 ` Charles Forsyth
  0 siblings, 2 replies; 5+ messages in thread
From: Steve Simon @ 2009-03-02 15:23 UTC (permalink / raw)
  To: 9fans

Hi,

I get a different type sygnature depending on weather the arg to a function
contains members which are in scope or not - is this expected or a bug?

for example:

/* junk.c */
typedef struct unknown unknown;
#ifdef DEF
struct unknown {
	int a;
};
#endif

typedef struct arg arg;
struct arg {
	unknown *u;		// Note pointer, not instance
};

void
func(arg a)
{
	USED(a);
}

larch% 8c -T t.c && nm -T junk.8
b0b8ed37  T func
larch% 8c -T -DDEF t.c && nm -T junk.8
763b103c  T func

-Steve



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-03  0:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-19  0:45 [9fans] type signatures erik quanstrom
2009-03-02 15:23 Steve Simon
2009-03-02 15:40 ` Fco. J. Ballesteros
2009-03-02 20:05   ` Steve Simon
2009-03-03  0:42 ` Charles Forsyth

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).