You can have a stack overflow with no arguments in the function call. Due
to the amount of previously stacked information before the call.
You'll want to limit the # of items you pass, for speed and efficiency.
for example instead of :
[color=blue]
> typedef struct t {
> char b[1024*1024*10]; // 10mb array.
> } T;
>
> T t1 , t2;
> ...
> myfunction(t1,t2);
> ...[/color]
try
myfunction ( &t1, &t2 );
as long as you tell myfunction that t1 is a pointer to that type of struct,
then the compiler works out the proper offsets for each member. You will,
however, need to access the members using "->" instead of ".".
t1->b
"jacob navia" <jacob@jacob.remcomp.fr> wrote in message
news:422d812f$0$1218$8fcfb975@news.wanadoo.fr...[color=blue]
>
ashok.anbalan@gmail.com wrote:[color=green]
>> Actually, this question occured to me when I trying to find if there
>> could be a potential stack overflow kind of situation even if there is
>> no recursion in play (with no terminating condition of course).
>>
>> Thanks,
>> Ashok
>>[/color]
> The standard defines that at least 127 argumnts must be supported in a
> function call, at translation time.
>
> This doesn't imply that 127 arguments should be supported at run-time but
> it could give a guideline.
>
> Of course if you have:
>
> typedef struct t {
> char b[1024*1024*10]; // 10mb array.
> } T;
>
> T t1 , t2;
> ...
> myfunction(t1,t2);
> ...
>
> many systems will crash, even if you have passed only 2 arguments!
>[/color]