Description of problem: GCC allows to declare arrays of zero length (a[0]). When using this the user is responsible to use the array correctly (accourding its bounds: a[3]=0).When using multidimensional arrays of zero length (a[0][0]), it is imposible to use it correctly (a[3][6]=0), because gcc is unable to calculate the correct offset. Please print an error or a warning, when using multidimensional zero length arrays. Version-Release number of selected component (if applicable): 4.6.1 gcc-4.6.1-9.fc15.i686 How reproducible: Compile this with 'gcc -Wall': ------------------------------ #include "string.h" #include "stdio.h" int main(void) { union { char a[0][0]; char b[16]; } u; strcpy( u.b, "0123456789"); unsigned int i = 0; unsigned int j = 0; for( i = 0; i < 4; ++i) { for( j = 0; j < 4; ++j) { printf("[%d][%d]: %c\n", i, j, u.a[i][j]); } } return 0; } ------------------------------ Actual results: [0][0]: 0 [0][1]: 1 [0][2]: 2 [0][3]: 3 [1][0]: 0 [1][1]: 1 [1][2]: 2 [1][3]: 3 [2][0]: 0 [2][1]: 1 [2][2]: 2 [2][3]: 3 [3][0]: 0 [3][1]: 1 [3][2]: 2 [3][3]: 3 Numbers from 0 to 9 are expected, but it is impossible for gcc to figure this out. Expected results: An error or at least a warning, that using multidimensional zero length arrays is a bad idea.
This message is a notice that Fedora 15 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 15. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '15' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 15 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping