Re: serious problems in GDB / LLDB debugger
Re: serious problems in GDB / LLDB debugger
- Subject: Re: serious problems in GDB / LLDB debugger
- From: Clark Cox <email@hidden>
- Date: Fri, 26 Aug 2011 08:08:43 -0700
On Tue, Aug 16, 2011 at 4:38 PM, Quincey Morris
<email@hidden> wrote:
> On Aug 16, 2011, at 15:25 , J wrote:
>
> Of course you're right, I should've given the code for the << operator on
> Mat4, here it is:
>
> std::ostream & operator << ( std::ostream & s, const Mat4 & v ) {
> static char txt[256];
> sprintf( txt, "%g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g", \
> v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ], \
> v[ 4 ], v[ 5 ], v[ 6 ], v[ 7 ], \
> v[ 8 ], v[ 9 ], v[ 10 ], v[ 11 ], \
> v[ 12 ], v[ 13 ], v[ 14 ], v[ 15 ] );
> s << txt;
> return s;
> }
>
> Incidentally, this may one of the cases when the difference between float
> and double matters. (I can never remember the rules about this. But others
> can.) If %g is expecting a double argument (I think it is), and the variable
> argument list isn't promoting your floats to doubles (I think it is not),
> you're producing garbage here.
FYI, the C varargs mechanism *always* promote floats to doubles.
Double vs. float only matters for the scanf-like functions, not the
printf-like ones.
--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden