This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69487] Unexpected VLA initialization of char[] from ""
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Jan 2016 13:54:39 +0000
- Subject: [Bug c++/69487] Unexpected VLA initialization of char[] from ""
- Auto-submitted: auto-generated
- References: <bug-69487-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69487
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-01-26
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The dumped trees show a memcpy from "" with the length as the length of the
array:
__builtin_memcpy (buffer.1_23, "", _15);
That should presumably use strnlen("", _15 - 1) or just be consistent with the
C front-end and reject it:
vla.c:20:5: error: variable-sized object may not be initialized