https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95993
Bug ID: 95993 Summary: the error of multi-array init in gcc 10.1 Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chengcongxiu at huawei dot com CC: webrown.cpp at gmail dot com Target Milestone: --- CC: webrown.cpp at gmail dot com the main2.cpp as follow: #include <iostream> using namespace std; void FuncA(int arg1, int arg2) { int i = 0, j = 0; unsigned char noConst = 2; const unsigned char index1 = 16; const unsigned char index2 = noConst; unsigned char temp3[index1][index2] = { 0 }; for(i = 0; i < index1; i++) { for(j = 0; j < index2; j++) { printf("%d\t", temp3[i][j]); } printf("\n"); } } int main() { FuncA(0, 0); return 0; } ./arm64be/bin/aarch64_be-linux-gnu-g++ main2.cpp -static -o app ./app0 the result is: 0 0 0 83 65 24 0 0 0 0 0 1 28 0 0 0 0 64 0 128 3 232 0 0 0 64 0 128 3 248 everyone know what's wrong? is the internal error of gcc?