Re: Problems with double arguments to varargs on MIPS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At some time ago,
Simon Kagstrom wrote:
> 
> [1  <text/plain; US-ASCII (7bit)>]
> Hello,
> 
> I have a problem with code generated by GCC for varargs on MIPS. 

[...]

>    double scratch;
> 
>    void maboo(int fmt, ...) {
>      va_list ap;
> 
>      va_start(ap, fmt);
>      scratch = (double)va_arg(ap, double);
>      va_end(ap);
>    }
> 
>    int main(int argc, char* argv[]) {
>      maboo(0, 1.9F);
> 
>      if ( !(scratch >= 1.89 && scratch <= 1.91) )
>        printf("ERRORERROR!\n");
>    }

[...]

I found the error - and I *think* it was on my part, but I'm not
sure. When I align the stack pointer at startup to 8 this seems to
work, so maybe this was the error all along? I've written the runtime
environment, so maybe this was just wrong.

Is the stack-alignment requirements spelled out somewhere? I quickly
glanced in the gcc and gccint info-pages, but didn't find it there.

// Simon

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux