On Tue, 17 Apr 2007, Standa Opichal wrote:
The 4 byte alignment is the default anyway when pushing
arguments on the stack, so you only need to take care of 64bit
values, which need special handling anyway.
Hmm, I remember having a lot of problems there, but that might
have been caused by -mshort usage in the FreeMiNT world...
Anyway, so if I say have a 'short' variable with a value of 0xabcd
and I use it as an argument for an ellipsis function (the nf_call()
in our case) it would store it like '0xXXXXabcd' on the stack.
Is that upper XXXX guaranteed to be 0000? Or do I need to cast
the value to be 4 byte wide to make it 0000? I am sorry if these
are obvious things for gcc insiders, but I just seem to remember
seeing interesting problems related to this and I am almost positive
that this wasn't just the -mshort case.
I've just tried :-)
| extern f(long id, ...);
|
| void g(short x)
| {
| f(0xdeadbeef, x, 0x12345678);
| }
Without -mshort, it puts a sign-extended 32-bit version of `x' on the stack.
With -mshort, it indeed puts a short on the stack.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html