diff options
author | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-08-06 13:54:31 +0000 |
---|---|---|
committer | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-08-06 13:54:31 +0000 |
commit | 23b6d074b5a3d2b154b753b9c9a922ce08fa7af2 (patch) | |
tree | 063487e2db73243c2d5c88ea8976332f3b31a730 /regress/gnu | |
parent | ab41e192369678a038022cc9b908389ae485d348 (diff) |
- fix makefile targets so c++ targets do get checked correctly
- update sscanf-cpp regress results to current error format
- add checks for variable length arrays to make sure they are ignored
Diffstat (limited to 'regress/gnu')
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/Makefile | 18 | ||||
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp | 4 | ||||
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/vararray-1.c | 11 | ||||
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/vararray-1.c.exp | 2 | ||||
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/vararray-2.c | 8 | ||||
-rw-r--r-- | regress/gnu/egcs/gcc-bounds/vararray-2.c.exp | 2 |
6 files changed, 34 insertions, 11 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile index e6891b6081f..3448d16de75 100644 --- a/regress/gnu/egcs/gcc-bounds/Makefile +++ b/regress/gnu/egcs/gcc-bounds/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.1 2003/06/26 18:37:28 avsm Exp $ +# $OpenBSD: Makefile,v 1.2 2003/08/06 13:54:30 avsm Exp $ -C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare sscanf +C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare sscanf vararray CPP_MODULES?= snprintf sscanf C_STRLCPY= 1 2 3 4 5 6 @@ -10,6 +10,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 C_SSCANF= 1 2 +C_VARARRAY= 1 2 CPP_SNPRINTF= 1 2 3 4 5 CPP_SSCANF= 1 @@ -22,27 +23,26 @@ REGRESS_TARGETS= ${C_TARGETS} ${CPP_TARGETS} .for i in ${C_MODULES} . for j in ${C_${i:U}} -C_TARGETS+= ${i}-${j} -${i}-${j}: +C_TARGETS+= c-${i}-${j} +c-${i}-${j}: ${TCC} ${TCFLAGS} -o /dev/null ${i}-${j}.c 2>&1 | diff -u - ${.CURDIR}/${i}-${j}.c.exp . endfor .endfor .for i in ${CPP_MODULES} . for j in ${CPP_${i:U}} -CPP_TARGETS+= ${i}-${j} -${i}-${j}: +CPP_TARGETS+= cpp-${i}-${j} +cpp-${i}-${j}: ${TCXX} ${TCXXFLAGS} -o /dev/null ${i}-${j}.cpp 2>&1 | grep -v 'misused' | diff -u - ${.CURDIR}/${i}-${j}.cpp.exp - . endfor .endfor generate: .for i in ${C_TARGETS} - -${TCC} ${TCFLAGS} -o /dev/null ${i}.c >${i}.c.exp 2>&1 + -${TCC} ${TCFLAGS} -o /dev/null ${i:C/^c-//g}.c >${i:C/^c-//g}.c.exp 2>&1 .endfor .for i in ${CPP_TARGETS} - -${TCXX} ${TCXXFLAGS} -o /dev/null ${i}.cpp >${i}.cpp.exp 2>&1 + -${TCXX} ${TCXXFLAGS} -o /dev/null ${i:C/^cpp-//g}.cpp >${i:C/^cpp-//g}.cpp.exp 2>&1 .endfor .PHONY: ${REGRESS_TARGETS} generate regress diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp b/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp index d240a6a54ce..8b979d48260 100644 --- a/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp +++ b/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp @@ -1,3 +1,3 @@ sscanf-1.cpp: In function `int main(int, char **)': -sscanf-1.cpp:6: warning: Array size 10 smaller than format string size 21 -sscanf-1.cpp:6: warning: Array size 10 smaller than format string size 11 +sscanf-1.cpp:6: warning: Array size (10) smaller than format string size (21) +sscanf-1.cpp:6: warning: Array size (10) smaller than format string size (11) diff --git a/regress/gnu/egcs/gcc-bounds/vararray-1.c b/regress/gnu/egcs/gcc-bounds/vararray-1.c new file mode 100644 index 00000000000..133979e3fdd --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-1.c @@ -0,0 +1,11 @@ +/* gcc used to barf on this with a 'not 8-byte aligned' error + * while correct behaviour is to ignore it */ + +#include <stdio.h> +#include <string.h> + +int main(int argc, char **argv) { + int sample_buffer[10][argc+10]; + memset(sample_buffer, 0, sizeof(sample_buffer)); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp b/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp new file mode 100644 index 00000000000..4bac0f8d578 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp @@ -0,0 +1,2 @@ +vararray-1.c: In function `main': +vararray-1.c:8: warning: ANSI C forbids variable-size array `sample_buffer' diff --git a/regress/gnu/egcs/gcc-bounds/vararray-2.c b/regress/gnu/egcs/gcc-bounds/vararray-2.c new file mode 100644 index 00000000000..d8e9617e88c --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-2.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <string.h> + +int main(int argc, char **argv) { + int sample_buffer[argc]; + memset(sample_buffer, 0, sizeof(sample_buffer)); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp b/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp new file mode 100644 index 00000000000..d1c99270e40 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp @@ -0,0 +1,2 @@ +vararray-2.c: In function `main': +vararray-2.c:5: warning: ANSI C forbids variable-size array `sample_buffer' |