This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
- From: "meklund at cisco dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Mar 2011 20:31:16 +0000
- Subject: [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
- Auto-submitted: auto-generated
- References: <bug-44384-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
--- Comment #2 from Mark Eklund <meklund at cisco dot com> 2011-03-29 20:31:15 UTC ---
I use FORTIFY_SOURCE with a USE_FORTIFY_LEVEL of 2
and was surprised that the below code allowed
writing into fu[4][0]. I expected that at a
level of 1, but not 2.
#include <string.h>
int bar ()
{
char fu[10][10];
strcpy(fu[3], "ten counts");
return 0;
}