I just tried to analyse the source code of gcc-4.8 trunk dated 20120415 with the latest cppcheck-1.54. It said [libgomp/config/linux/lock.c:178]: (warning) Using size of pointer lock instead of size of its data. Source code is void gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock) { memset (lock, 0, sizeof (lock)); } Maybe better is void gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock) { memset (lock, 0, sizeof (*lock)); }
For LP64I32 targets, the code will most likely just work correctly as the struct will be two ints which is the same size as one pointer. While for LPI32 targets, it will be broken. So confirmed.
Author: jakub Date: Wed Jun 6 18:31:06 2012 New Revision: 188276 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188276 Log: PR libgomp/52993 * config/linux/lock.c (gomp_init_nest_lock_25): Fix up last argument to memset call. Modified: trunk/libgomp/ChangeLog trunk/libgomp/config/linux/lock.c
Not a big deal, since this is a Linux only file, and on Linux LIBGOMP_GNU_SYMBOL_VERSIONING should be defined, therefore the code isn't compiled in. Fixed onthe trunk anyway, not worth backporting.
Author: jakub Date: Thu Jun 14 17:46:53 2012 New Revision: 188624 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188624 Log: Backported from mainline 2012-06-06 Jakub Jelinek <jakub@redhat.com> PR libgomp/52993 * config/linux/lock.c (gomp_init_nest_lock_25): Fix up last argument to memset call. Modified: branches/gcc-4_7-branch/libgomp/ChangeLog branches/gcc-4_7-branch/libgomp/config/linux/lock.c