home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
prog
/
c
/
rconfig.lha
/
RConfig_v1.1
/
tests
/
4b
/
test4b.c
< prev
Wrap
C/C++ Source or Header
|
1992-09-12
|
722b
|
37 lines
/*
* RConfig Validation Suite by Anthon Pang, Omni Communications Products
*
* Object Code: risky alloca
* Assigned Test # 4b
* Requirements: rlib.h
* Desired Observation(s): Prints address of block allocated
*/
#include <stdio.h>
#include "alloca.h"
void test(int t) {
char *p;
int x;
/*
* risky alloca() takes as its only parameter the size of the block
* to allocate; it makes the bold assumption that register a5 is
* used in the current procedure for a local stack frame
*/
p = (char*)alloca(t);
if (p==NULL) {
printf("Unable to alloca()\n");
return;
}
printf("%ld\n", p);
}
main() {
test(16384);
puts("Done.\n");
}