Why do I get a false "array subscript is above array bounds" warning message when compiling my MEX file with GCC on MATLAB 7.10 (R2010a)?
이전 댓글 표시
When I compile the following code:
typedef struct {
int chunks[3];
} S;
void f(int y[])
{
int nc;
int i = 0;
for (nc = 0; nc < 3; nc = nc + 1) {
i = i + 1;
}
if (i < 3) {
y[i] = 0;
}
}
int main(void)
{
S tmp;
f(tmp.chunks);
return 0;
}
with this command:
gcc -Wall -O3 s3.c
I get the following warning message:
s3.c: In function 'main':
s3.c:15: warning: array subscript is above array bounds
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!