📄 app2.c
字号:
/*
* Copyright 1999, 2000, 2001, 2002 Lucent Technologies Inc.
* All Rights Reserved.
* Information Sciences Research Center, Bell Labs.
*
* LUCENT TECHNOLOGIES DOES NOT CLAIM MERCHANTABILITY OF THIS SOFTWARE
* OR THE SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE. The
* software is provided "as is" without expressed or implied warranty
* of any kind.
*
* These notices must be retained in any copies of any part of this
* software.
*
*/
/*
* test stack overflow
*/
#include "pebble.h"
#define N 100
static char *tos;
void
f(int i)
{
char x[N];
printf("call depth=%d: stack at %p size so far=%d\n",
i, x, tos - x);
f(i+1);
}
int
main(void)
{
char x;
printf("testing Pebble stack overflow\n");
printf("THIS PROGRAM SHOULD TERMINATE WITH A STACK OVERFLOW MESSAGE\n");
tos = (char *)&x;
/* infinite recursion */
f(1);
printf("should never reach here!\n");
task_exit(0);
return 0; /* to make gcc happy */
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -