Perhaps the layout in memory of the two versions of the struct isn't the same? I tried this in gcc:
#include <stdio.h>
struct WTO_PARM {
unsigned short len;
unsigned short code;
char *text;
};
int main()
{
struct WTO_PARM moo = { 4+11,0,"hello" };
printf("size %zu struct %p string %p\n", sizeof(struct WTO_PARM),&moo,moo.text);
return 0;
}
Here are the results:
size 8 struct 0x22cce0 string 0x402000
However, if I change the type of the text parameter to char[80], the results change to:
size 84 struct 0x22cc80 string 0x22cc84
The WTO instruction likely expects the string to be packed right into that struct.
Matt Kane
2009-06-03 14:01:09