Arrgghh! They are passing addresses of va_lists all over the place.
Under ppc linux and s390 linux, va_list is actualy based on an array type. So they are trying to pass the address of the array (which itself is a pointer) and all hell breaks loose.
They then assume the *args is a va_list argument everyplace.
Passing addresses of a va_list is not portable in any way AFAIK.
I have no idea if what I did even compiles but you should get the general idea. Just think that va_list is an array. Taking the address of an array makes no sense (you pass the array and it is automatically a pointer) and then taking the contents of that also can be an issue.
Whereas passing the address of an element of the array is perfectly fine.
I tried something using macros that may do the trick.
Hope this helps.
On December 12, 2001 08:22, Jacob Vennervald Madsen wrote:
Thanks a lot. Here are the .h and .c files.
In these three methodes I get a warning when compiling: format_width format_prec convert
These are the warnings I get: gwlib/octstr.c: In function `octstr_format_valist': gwlib/octstr.c:1985: warning: passing arg 3 of `format_width' from incompatible pointer type gwlib/octstr.c:1986: warning: passing arg 3 of `format_prec' from incompatible pointer type gwlib/octstr.c:1988: warning: passing arg 4 of `convert' from incompatible pointer type
I also suspect these methods: octstr_format octstr_format_valist octstr_format_append
Hope you can help.
-----Original Message----- From: Kevin B. Hendricks [mailto:email@example.com] Sent: 12. december 2001 13:58 To: Jacob Vennervald Madsen; firstname.lastname@example.org Subject: Re: [suse-ppc] Varargs works different on SuSe PPC
After debugging it I found out that there is a difference in the way that va_arg works on different platforms.
Yes there is and ppc linux is one of the more strange versions.
I've been told to try to update my glibc to the latest version but I have version 2.2.4-19, which I think is the latest. As I've understood it's another compiler, right? Is there a ppc rpm for this?
Please ignore all of that "advice", it is bad.
The problem is in the program itself. It is not using cross-platform code to do varargs the right way. Thrre are now macros defined that will allow most ofthe differences to be properly taken care of.
Please post the routine from the program that is causing the problem (i.e. using varargs incorrectly for cross platform independence) and I can show you how to fix it. Then you can submit a patch to the maintainer of that program so that they start ding things in a more coross-platform manner.