DSPRelated.com
Forums

printf is filled with evil

Started by sr_gamer July 23, 2009
so I'm writing this to the ezDSP:

#include

void main(void)
{
int i;

for(i=0;i<10;i++)
printf("smelly monkey\n");
}

sometimes it outputs great, other times I get:
smelly monkey
smelly monkey
smelly monkey
smelly monkey

or other numbers of smelly monkeys - where are my missing monkeys?

_____________________________________
Seems like you might be corrupting the stack.If you did not allocate sufficient memory for the stack, this might happen due to corruption of some of the intermediate variables etc. I cannot be sure.. This is just a probable reason.. Try increasing the stack depth.

________________________________
From: sr_gamer
To: c...
Sent: Tuesday, 21 July, 2009 5:53:34 PM
Subject: [code-comp] printf is filled with evil


so I'm writing this to the ezDSP:

#include

void main(void)
{
int i;

for(i=0;i<10; i++)
printf("smelly monkey\n");
}

sometimes it outputs great, other times I get:
smelly monkey
smelly monkey
smelly monkey
smelly monkey

or other numbers of smelly monkeys - where are my missing monkeys?

_____________________________________
Another probable -
Try putting some delay before you start printing.

Regards,
Raju Udava.

On Mon, Jul 27, 2009 at 6:15 AM, vignesh j.s. wrote:

> Seems like you might be corrupting the stack. If you did not allocate
> sufficient memory for the stack, this might happen due to corruption of some
> of the intermediate variables etc. I cannot be sure.. This is just a
> probable reason.. Try increasing the stack depth.
>
> ________________________________
> From: sr_gamer >
> To: c...
> Sent: Tuesday, 21 July, 2009 5:53:34 PM
> Subject: [code-comp] printf is filled with evil
> so I'm writing this to the ezDSP:
>
> #include void main(void)
> {
> int i;
>
> for(i=0;i<10; i++)
> printf("smelly monkey\n");
> }
>
> sometimes it outputs great, other times I get:
> smelly monkey
> smelly monkey
> smelly monkey
> smelly monkey
>
> or other numbers of smelly monkeys - where are my missing monkeys?
>

_____________________________________