This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C163 - unknown array size

Hi,
why do I get this c163, if I try to compile following sequence? Shouldn't be a problem for a c-compiler to determine the array-size.

code const char code *EinstellMenue[][] = {{
" Einstellungen ",
" (up/dn/esc) ",
" F1 Messstellen ",
" F2 Kalibrierung ",
" F3 Verschiedenes ",
" F4 Statistik "
},{
" Settings ",
" (up/dn/esc) ",
"F1 Measuring points ",
"F2 Calibration ",
"F3 Miscellaneous ",
"F4 Statistic "
}};

Regards
Eckhard

Parents
  • Since C166 is supposed to be an ANSI C compiler, I tried to verify that the 'common sense' approach does not deviate from the standard. I have the ISO C 1999 standard, but I don't think it differs from ANSI C in this matter.
    It says:
    The element type shall not be an incomplete or function type.
    An array with unspecified size is an incomplete type. Since a two-dimensional array is an array of arrays, it should mean that one of the two indices in a two-dimensional array declarator must be specified.
    Now which one can be omitted: the one on the left or the one on the right? According to common sense, the one on the left. Funny, I could not derive that from the text of the standard.
    Regards,
    - Mike

Reply
  • Since C166 is supposed to be an ANSI C compiler, I tried to verify that the 'common sense' approach does not deviate from the standard. I have the ISO C 1999 standard, but I don't think it differs from ANSI C in this matter.
    It says:
    The element type shall not be an incomplete or function type.
    An array with unspecified size is an incomplete type. Since a two-dimensional array is an array of arrays, it should mean that one of the two indices in a two-dimensional array declarator must be specified.
    Now which one can be omitted: the one on the left or the one on the right? According to common sense, the one on the left. Funny, I could not derive that from the text of the standard.
    Regards,
    - Mike

Children
No data