* [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
* [9fans] type signatures
2009-03-02 15:23 [9fans] type signatures Steve Simon
@ 2009-03-02 15:40 ` Fco. J. Ballesteros
2009-03-02 20:05 ` Steve Simon
2009-03-03 0:42 ` Charles Forsyth
1 sibling, 1 reply; 5+ messages in thread
From: Fco. J. Ballesteros @ 2009-03-02 15:40 UTC (permalink / raw)
To: 9fans
Isn't this what
#pragma incomplete
is for?
> From: steve@quintile.net
> To: 9fans@9fans.net
> Reply-To: 9fans@9fans.net
> Date: Mon Mar 2 16:24:23 CET 2009
> Subject: [9fans] type signatures
>
> 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
* Re: [9fans] type signatures
2009-03-02 15:40 ` Fco. J. Ballesteros
@ 2009-03-02 20:05 ` Steve Simon
0 siblings, 0 replies; 5+ messages in thread
From: Steve Simon @ 2009-03-02 20:05 UTC (permalink / raw)
To: 9fans
> Isn't this what
> #pragma incomplete
> is for?
yep, I completely forgot about it.
Thanks,
-Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] type signatures
2009-03-02 15:23 [9fans] type signatures Steve Simon
2009-03-02 15:40 ` Fco. J. Ballesteros
@ 2009-03-03 0:42 ` Charles Forsyth
1 sibling, 0 replies; 5+ messages in thread
From: Charles Forsyth @ 2009-03-03 0:42 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 99 bytes --]
that seems correct. if you want an incomplete type, you can specify that
(with pragma incomplete).
[-- Attachment #2: Type: message/rfc822, Size: 2160 bytes --]
From: "Steve Simon" <steve@quintile.net>
To: 9fans@9fans.net
Subject: [9fans] type signatures
Date: Mon, 2 Mar 2009 15:23:01 +0000
Message-ID: <307e6ea2aed293668f8a7caacb1b5e2b@quintile.net>
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
* [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
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 --
2009-03-02 15:23 [9fans] type signatures Steve Simon
2009-03-02 15:40 ` Fco. J. Ballesteros
2009-03-02 20:05 ` Steve Simon
2009-03-03 0:42 ` Charles Forsyth
-- strict thread matches above, loose matches on Subject: below --
2008-01-19 0:45 erik quanstrom
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).