News for hackers. Stuff that matters.
Re:A nice, little known C feature: Static array indices in p... by kelnos on Monday February 18, 2013 @03:55PM (#5240582)
As another poster said, the compiler can't know inside the function body the size of the array passed if you just use sizeof.

More to a style/safety point, if I ever see a function that expects an array and doesn't also take the size of that array as another parameter, that's a bug waiting to happen.

Especially in this case since this feature seems to only throw a warning on recent versions of clang, and more or less nothing else.

There are no comments on this comment yet.