Skip to content

Support array arguments with static keyword

Emmanuele Bassi requested to merge issue-309 into master

C99 allows defining an array argument with a fixed size as:

void foo (int arr[static 10])

Compilers conforming to the C99 specification will be able to warn if the function is called with NULL or with an array smaller than the specified length, something that does not happen when using pre-C99 declarations like:

void foo (int arr[10])

As the declaration above is identical to:

void foo (int arr[])

Which is, in turn, identical to:

void foo (int *arr)

Fixes: #309 (closed)

Edited by Emmanuele Bassi

Merge request reports