gcc varargs problem

Sam Varshavchik mrsam at courier-mta.com
Fri Aug 1 02:22:56 UTC 2008


whoosh writes:

> On 01-Aug-08 03:00:09 Tom Horsley wrote:
>>On Fri, 01 Aug 2008 02:36:54 +0100
>>whoosh <whoosh777 at blueyonder.co.uk> wrote:
> 
>>> 64 bit Fedora 9's gcc regards this as an error, all the other gcc's eg 
>>> on 32 bit Fedora Core 3 have no problem with this.
> 
>>The standard regards it as an error as well, and if you looked up
>>the insane argument passing conventions for x86_64, you'd know why :-).
>>If you want to write portable code, look at the stdarg man page and
>>use the va_start, va_copy, etc. macros.
> 
> 
> ok, from that man page it looks like the way to do it is:
> 
> f( va_list *pargs )

No, that's not what that man page states. See the EXAMPLE section.

> is there a way to switch off the signedness errors, where 
> 
> I use "unsigned char *" for strings to prevent char 255 being
> 
> sign extended to EOF?

Use explicit casts.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20080731/0ab98753/attachment-0001.bin 


More information about the users mailing list