DSPRelated.com
Forums

Max Number Of Arguments passed to function is t maximum 4?

Started by Zulfiqar Khan June 4, 2004
Hello
Can any one help me in solving the following problem :

If numbe of aguments passed to a funcrion exceeds from
4 the function gives irrtaing behaviour. I mean if fo
example i passed the argumnt 315 to the function the
function converts it to 0 & then to 235, i.e. no
contol on the value.

I have increased the stack size but it does not solve
my problem

Looking for the favourarable reply

Zulfiqar

__________________________________



Hi,

No.. total number of arguments that u can pass to a function is not 4 for sure.. I had similar kind of problem with my system... the thing is the arguments are being passed thru regsiters and if all registers are used up then thru stack...

The reason I see for changing values ( when u pass them to function) is because after you pass the arguments.. the registers are used by the processor to perform different tasks so the register no longer represents the variable.. ( wht i mean to say is regsiter is not fixed address of the variable) value of variable is placed on to stack .. and later on accessed back when needed.. all this is internally taken care of by compiler .. provided u hav proper stack allocation .. ..

I would definately recommend you to go thru part 8.4  Run time  Environment (  of TMS320C6000 Optimizing Compiler Users Guide (SPRU187K)
http://focus.ti.com/lit/ug/spru187k/spru187k.pdf

hope this helps..

Best Regards,

Tarang Dadia
Graduate Student
Wireless Networking Lab
University of Texas - Arlington
On Sat, 05 Jun 2004 Andrew Nesterov wrote :
>It seem as if the erroneous function call differs from the
>function declaration. There are three places to check to
>be coherent: the function declaration (in an include file),
>the function definition (check the paramemters of the
>implementation) and the function call.
>The stack size wouldn't affect on a call with a resonable
>number of arguments, since they are passed in the registers.
>Regards,
>Andrew
>> Date: Thu, 3 Jun 2004 20:45:45 -0700 (PDT)
>> From: Zulfiqar Khan <z...@yahoo.com>
>> Subject: Max Number Of Arguments passed to function  is t maximum 4?
>>
>> Hello
>> Can any one help me in solving the following problem :
>>
>> If numbe of aguments passed to a funcrion exceeds from
>> 4 the function gives irrtaing behaviour. I mean if fo
>> example i passed the argumnt 315 to the function the
>> function converts it to 0 & then to 235, i.e. no
>> contol on the value.
>>
>> I have increased the stack size but it does not solve
>> my problem
>>
>> Looking for the favourarable reply
>>
>> Zulfiqar
>>
>_____________________________________
>Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.
>_____________________________________
>About this discussion group:
>To Join:  c...@yahoogroups.com
>To Post:  c...@yahoogroups.com
>To Leave: c...@yahoogroups.com
>Archives:
>http://www.yahoogroups.com/group/code-comp
>More Groups:
>http://www.dsprelated.com
>
>Yahoo! Groups Links
>To BR> >.
>