Daniel Kobras writes: > On Tue, Aug 24, 2004 at 06:21:57PM +0200, Kevin Glynn wrote: > > fyi, it is because va_list is declared as a one-element array of > > structs on powerpc, unlike other architectures so code like: > > > > va_list Arg4 = (va_list) OZ_getForeignPointer((*(_OZ_LOC[(4)]))); > > > > fails on powerpc, because you can't cast to an array. > > And you may not assign to a va_list. Use va_copy() instead to be > portable. > > Daniel. >
I don't see how va_copy will help me. OZ_getForeignPointer(...) returns a void*, so I will still need to cast it to a va_list to be able to call va_copy. Here is my test program, perhaps you can suggest an alternative: typedef struct __kk_va_list_tag { unsigned char gpr; unsigned char fpr; char *overflow_arg_area; char *reg_save_area; } __kk_va_list[1], __kk_gnuc_va_list[1]; typedef __kk_gnuc_va_list kk_va_list; extern void kk_va_copy(kk_va_list dest, kk_va_list src); /* #include <stdarg.h> */ main () { kk_va_list Arg4; kk_va_copy(Arg4, ((void *)0)); } @quaver:tmp 4Q> g++ -c kk.c kk.c: In function `int main()': kk.c:18: error: invalid conversion from `void*' to `__kk_va_list_tag*' Thanks for all advice, k PS. Sorry for unwanted ccs, let me know and I will remove. I am not subscribed to debian-powerpc, but can check the archives for responses. -- ------------- you're invited to: ------------------------- The Second International Mozart/Oz Conference (MOZ 2004) Charleroi, Belgium, Oct. 7-8, 2004 http://www.cetic.be/moz2004 ----------------------------------------------------------