Implement alloca.h

This commit is contained in:
Tibor Nagy
2018-11-23 21:31:09 +01:00
parent 9790289aec
commit 55eb8f2779
5 changed files with 20 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#ifndef _ALLOCA_H
#define _ALLOCA_H
#define alloca(size) __builtin_alloca (size)
#endif /* _ALLOCA_H */
+1
View File
@@ -1,5 +1,6 @@
# Binaries that should generate the same output every time
EXPECT_BINS=\
alloca \
args \
arpainet \
assert \
+12
View File
@@ -0,0 +1,12 @@
#include <alloca.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char ** argv) {
char *str = (char *) alloca(17);
memset(str, 'A', 16);
str[16] = '\0';
printf("%s\n", str);
}
View File
+1
View File
@@ -0,0 +1 @@
AAAAAAAAAAAAAAAA