diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-06 19:00:10 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-06 19:00:10 +0000 |
commit | 87d59e72dfe85065aa3fdefdd01dd538292392ea (patch) | |
tree | dbe62f51aeeeb3f4e0e71eea55e603f187e0fdbf /libgomp | |
parent | 36cd680eeb9e824a38efc71f8c3d1af82e971eb1 (diff) | |
download | gcc-87d59e72dfe85065aa3fdefdd01dd538292392ea.tar.gz |
PR c/6940
* doc/invoke.texi: Document -Wsizeof-array-argument.
c-family/
* c.opt (Wsizeof-array-argument): New option.
c/
* c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
* c-tree.h (C_ARRAY_PARAMETER): Define.
* c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
function parameter.
cp/
* cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
* decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
* typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
function parameter.
testsuite/
* c-c++-common/Wsizeof-pointer-memaccess1.c: Use
-Wno-sizeof-array-argument.
* c-c++-common/Wsizeof-pointer-memaccess2.c: Likewise.
* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Likewise.
* gcc.dg/Wsizeof-pointer-memaccess1.c: Likewise.
* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Likewise.
* g++.dg/torture/Wsizeof-pointer-memaccess2.C: Likewise.
* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise.
* c-c++-common/sizeof-array-argument.c: New test.
* gcc.dg/vla-5.c: Add dg-warnings.
../libgomp/
* testsuite/libgomp.c/appendix-a/a.29.1.c (f): Add dg-warnings.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ee2e264e58b..dbfc03cb815 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-06 Marek Polacek <polacek@redhat.com> + + PR c/6940 + * testsuite/libgomp.c/appendix-a/a.29.1.c (f): Add dg-warnings. + 2014-07-03 Jakub Jelinek <jakub@redhat.com> * testsuite/lib/libgomp.exp (libgomp_target_compile): If $source diff --git a/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c b/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c index 6f0f65fa03e..484321207c8 100644 --- a/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c +++ b/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c @@ -11,8 +11,8 @@ f (int n, int B[n][n], int C[]) E[1][1] = 4; #pragma omp parallel firstprivate(B, C, D, E) { - assert (sizeof (B) == sizeof (int (*)[n])); - assert (sizeof (C) == sizeof (int *)); + assert (sizeof (B) == sizeof (int (*)[n])); /* { dg-warning "on array function parameter" } */ + assert (sizeof (C) == sizeof (int *)); /* { dg-warning "on array function parameter" } */ assert (sizeof (D) == 4 * sizeof (int)); assert (sizeof (E) == n * n * sizeof (int)); /* Private B and C have values of original B and C. */ |