ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Вторник
2 июля
414071 Топик полностью
SciFi (30.05.2013 17:13 - 17:16, просмотров: 63) ответил kosig на Здравствуйте. Увидел в чужом коде такую конструкцию uint8_t buf[const static 31] - это один из параметров, передаваемых в функцию. Как это понимать? По идее массив с данными, постоянно меняющимися.
Круто, не знал про такую фишку: 
A declaration of a parameter as "array of type" shall be adjusted to "qualified pointer to type", where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation. If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.
Получается, что компилятор будет ругаться, если внутри функции попытаться записать в этот массив или прочитать элемент с индексом больше 31.
ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้