mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Initial import into SourceForge CVS
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14685 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
31
test_programs/stack_extension_test.c
Normal file
31
test_programs/stack_extension_test.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* gcc -mstackextend -o stack_extension_test stack_extension_test.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
void
|
||||
recursive_function(char *data,int data_size,int level)
|
||||
{
|
||||
char local_data[10000];
|
||||
char line[10];
|
||||
int c;
|
||||
|
||||
data_size += sizeof(local_data);
|
||||
level++;
|
||||
|
||||
printf("recursion level=%d, size=%d; continue? ",level,data_size);
|
||||
|
||||
fgets(line,sizeof(line),stdin);
|
||||
c = toupper(line[0]);
|
||||
|
||||
if(c == 'Y')
|
||||
recursive_function(local_data,data_size,level);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,char ** argv)
|
||||
{
|
||||
recursive_function(NULL,0,0);
|
||||
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user