summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravsm <avsm@openbsd.org>2004-08-08 13:11:10 +0000
committeravsm <avsm@openbsd.org>2004-08-08 13:11:10 +0000
commit25fd17ca82f6922d2747f54a58759e1c942bda13 (patch)
treed2cb9f5dd10ae695c18d43c4b41194b62953433c
parentprint vmemoryuse immediately after vmemoryuse in limit output (diff)
downloadwireguard-openbsd-25fd17ca82f6922d2747f54a58759e1c942bda13.tar.xz
wireguard-openbsd-25fd17ca82f6922d2747f54a58759e1c942bda13.zip
check for variable sized array in format arguments
-rw-r--r--regress/gnu/egcs/gcc-bounds/Makefile4
-rw-r--r--regress/gnu/egcs/gcc-bounds/vararray-3.c10
-rw-r--r--regress/gnu/egcs/gcc-bounds/vararray-3.c.exp2
3 files changed, 14 insertions, 2 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile
index 88f09e27d86..305a92967ca 100644
--- a/regress/gnu/egcs/gcc-bounds/Makefile
+++ b/regress/gnu/egcs/gcc-bounds/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2004/07/09 22:24:41 avsm Exp $
+# $OpenBSD: Makefile,v 1.9 2004/08/08 13:11:10 avsm Exp $
C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare \
sscanf vararray md builtins
@@ -11,7 +11,7 @@ C_MEMCPY= 1 2 3 4 5 6
C_FREAD= 1 2 3 4
C_DECLARE= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
C_SSCANF= 1 2 3 4 5
-C_VARARRAY= 1 2
+C_VARARRAY= 1 2 3
C_MD= 1 2 3 4 5 6
C_BUILTINS= 1
diff --git a/regress/gnu/egcs/gcc-bounds/vararray-3.c b/regress/gnu/egcs/gcc-bounds/vararray-3.c
new file mode 100644
index 00000000000..b1d361f406d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/vararray-3.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+int
+main(int argc, char **argv)
+{
+ int a;
+ char buf[10], buf2[a];
+ sscanf(buf, "%s", buf2);
+ return 1;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/vararray-3.c.exp b/regress/gnu/egcs/gcc-bounds/vararray-3.c.exp
new file mode 100644
index 00000000000..91a07e6309f
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/vararray-3.c.exp
@@ -0,0 +1,2 @@
+vararray-3.c: In function `main':
+vararray-3.c:7: warning: ANSI C forbids variable-size array `buf2'