From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FFCF3861830; Tue, 3 Nov 2020 05:26:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FFCF3861830 From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/70075] incorrect initialization of multidimensional VLAs Date: Tue, 03 Nov 2020 05:26:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 05:26:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D70075 Eric Gallager changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egallager at gcc dot gnu.o= rg --- Comment #5 from Eric Gallager --- (In reply to Eric Gallager from comment #3) > (In reply to Eric Gallager from comment #2) > >=20 > > I get this output on i386-apple-darwin9.8.0 with gcc8: > >=20 > > $ /usr/local/bin/g++ -Wall -Wextra -Wpedantic -o 70075.exe 70075.cc > > 70075.cc: In function =E2=80=98void bar(int)=E2=80=99: > > 70075.cc:4:13: warning: ISO C++ forbids variable length array =E2=80=98= a=E2=80=99 [-Wvla] > > char a[m][n] =3D { { 0, 1, 2 } }; > > ^ > > $ ./70075.exe > > 0 1 2 0 0 0 -32 -113=20 > > $ > >=20 > > (i.e. no errors) >=20 > Running the program on x86_64-apple-darwin10.8.0 with gcc9, it prints this > instead: > 0 1 2 0 9 0 0 0 > (still no errors though) Update for gcc 11 on x86_64-apple-darwin19.6.0: 0 1 2 0 0 0 0 0 So, not only are there no errors now, but it also looks like everything aft= er the "0 1 2" is now properly zero-initialized? FIXED?=