Closed iphydf closed 6 months ago
Actually this was on purpose.. but in this case I may change the category instead of warning "note".
But I need to check.. because the style warning I was talking about is this code
void foo(char x[10]) {
x = 0;
}
I guess that makes sense. Assigning params is a bad idea anyway. I'll refactor my code. No need to fix this.
I agree that something is wrong..it could be an error.
int main(){
int a[2];
int b[2];
a = b; //this is where the error is correct.
}
Yes, that's a 100% correct error because that code is invalid. In the parameter case, it's valid C code, but I'd argue nobody should write that code. It's better to have a local pointer variable and assign the parameter to that.
This should be fine.
x
is actually a pointer parameter, andy
can decay to a pointer. It's useful for static analysis to treat the[10]
as array in some cases, but this assignment should be allowed.