News for hackers. Stuff that matters.
Re:Some dark corners of C by gjulianm on Saturday March 09, 2013 @06:45AM (#5348121)
I didn't know that. To answer my previous question, clang doesn't fire a warning when passing pointers of any size to the function foo.

And by the way, nice talk, it's great learning these dark secrets of C.

Re:Some dark corners of C by rjek on Saturday March 09, 2013 @06:59AM (#5348152)
The compiler can't know at compile time with a naked pointer like it can with an array. [static 1] is handy to say it must not explicitly be NULL, as if it were optional, however.
Re:Some dark corners of C by gjulianm on Saturday March 09, 2013 @07:11AM (#5348169)
Yes, but I expected some kind of "You're passing a pointer as an array of size n. I can't check the size, but you should make sure you've checked it".
Re:Some dark corners of C by ori_b on Saturday March 09, 2013 @01:35PM (#5349153)
I can't imagine that would be anything but noise. 99% of my function calls have pointers passed through, not arrays.
Re:Some dark corners of C by adsr on Saturday March 09, 2013 @06:55AM (#5348146)
But a pointer is not the same thing as an array, a pointer does not carry the size of the allocated space which an array does in the same scope.