It's as if they go around looking for places in the grammar they can unambiguously stick "static" and then back-rationalize a meaning for it.
It's as if they go around looking for places in the grammar they can unambiguously stick "static" and then back-rationalize a meaning for it.
echo 'int my_func(int i, int arr[*]);' > main.c
gcc -c -std=c99 main.c
-- * observe that there are no errors * --
See 6.7.5.2 Array declarators for details
http://port70.net/~nsz/c/c99/n1256.htmlEdit: I can't figure out how to escapse an asterisk, so the above might not read correctly but I tried.
In code blocks *asterisks* don't need any special
escaping as they always show up "as is". int foo(char [][*]);
int bar(char [][]);
The second declaration should give an error.I'm getting this from just reading the spec now, but it looks like the reason has to do with "incomplete" versus "complete" types.
Something like 'int arr[]' is an "incomplete type", i.e. an array of ints with unspecified size. While 'int arr[*]' is a complete type for an array with variable length. I'm guessing that array elements must have a complete type, which is why the above snippet gives an error.
I would think that that's exactly what they do, in order to avoid breaking existing code by introducing any more reserved words.
The actual keywords are defined with a leading underscore and a capital letter. The standard reserves all such identifiers for implementation, and so no valid conforming program should contain any such.
Thus, you get keywords like _Bool and _Complex. And then, to make them look nice, there are headers like <stdbool.h> which basically just do #define bool _Bool etc.