logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: va_list pointers, bad(?) gcc code: msg#00022

Subject: Re: va_list pointers, bad(?) gcc code
I guess it's too late to change it now. The ABI defines va_list as:

typedef struct
        unsigned int gp_offset;
        unsigned int fp_offset;
        void *overflow_arg_area;
        void *reg_save_area;
} va_list[1];

I don't know what purpose it served to make it an array, except that
it makes certain it's never passed as a structure. But it also creates
problems like the one I saw.

I think this construction was copied from the powerpc ABI. I did
follow some of the ABI discussions at the time, but never thought
about this one until I stumbled in to this.

Changing it now would be an ABI change, which would be a major problem,
although you could frotz it by declaring it to be a pointer to
this structure instead, and have gcc do an internal alloca to
create space for it on the stack. Or something.. but that sounds
pretty hackish.

- Frank



<Prev in Thread] Current Thread [Next in Thread>