summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2006-07-11 11:59:54 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2006-07-11 11:59:54 +0000
commit26308e5c824d27e7d7aaf5544f33a605be06e9a5 (patch)
tree1a152e411dd2fe7df460cc0009728f2ce9d07d75 /regress
parent4e96aca4b11e0dde8c8e09a561ba32cac7f29dbf (diff)
add another regress for the recent -Wbounded fixes
Diffstat (limited to 'regress')
-rw-r--r--regress/gnu/egcs/gcc-bounds/Makefile4
-rw-r--r--regress/gnu/egcs/gcc-bounds/sscanf-6.c8
-rw-r--r--regress/gnu/egcs/gcc-bounds/sscanf-6.c.exp.gcc34
3 files changed, 14 insertions, 2 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile
index 305a92967ca..1302bca8ae1 100644
--- a/regress/gnu/egcs/gcc-bounds/Makefile
+++ b/regress/gnu/egcs/gcc-bounds/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.9 2004/08/08 13:11:10 avsm Exp $
+# $OpenBSD: Makefile,v 1.10 2006/07/11 11:59:53 avsm Exp $
C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare \
sscanf vararray md builtins
@@ -10,7 +10,7 @@ C_GETCWD= 1 2 3 4
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_SSCANF= 1 2 3 4 5 6
C_VARARRAY= 1 2 3
C_MD= 1 2 3 4 5 6
C_BUILTINS= 1
diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-6.c b/regress/gnu/egcs/gcc-bounds/sscanf-6.c
new file mode 100644
index 00000000000..6cbd8c5f0a6
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/sscanf-6.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ char buf[20];
+ int a[2], b;
+ sscanf(buf, "%3d %d %3d %30s %50d %20c %21c", &a[0], &a[1], &b, buf, buf, buf, buf);
+ return 0;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-6.c.exp.gcc3
new file mode 100644
index 00000000000..39d8d12dc4f
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/sscanf-6.c.exp.gcc3
@@ -0,0 +1,4 @@
+sscanf-6.c: In function `main':
+sscanf-6.c:6: warning: Array size (20) smaller than format string size (31) (arg 6)
+sscanf-6.c:6: warning: int format, different type arg (arg 7)
+sscanf-6.c:6: warning: Array size (20) smaller than format string size (21) (arg 9)