Random C issue, was (Re: [vorbis-dev] getting playback length from ogg vorbis file)

Jack Angel man at oceanography.ru
Tue Jul 15 13:37:55 PDT 2003



On Tue, 15 Jul 2003 16:17:37 -0400
Peter Harris <peter.harris at hummingbird.com> wrote:

> Jack Angel wrote:
> > why doesn't it coerce this double to int as it would if i declared floor as
> > "int floor(int)" ?
> 
> It does, which is exactly why the function isn't operating the way you 
> expect (there is no coersion from (int) back to (double) on the other end).

i'm talking about stack corruption
does double get coerced to int?
if so, 4 bytes are pushed to the stack
what code does this implicit definition contain?
e.g., does it return something at all? or only pops args back?
if it pops, doesn't it pop 4 bytes?
i don't see why the stack gets corrupted
why do you think such thing got in the standard?
i mean, what's useful in such dangerous things?

<p>also, gcc picks up printf definition from somewhere (and does printf right), even if i don't include <stdio.h>
isn't that bad?
i may forget about <stdio.h>, and other compiler will fail (or is there smth in the standard about this?)

> 
> Peter Harris
> 
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
> 

<p>
-- 
The human knowledge belongs to the world
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list