Re:The Linux Kernel Is Now VLA (Variable-Length Array) Free
by ndesaulniers on Monday October 29, 2018 @01:25AM
(#18325260)
Is there a call site that passes void to that macro?
[ Parent
| on HN ]
Re:The Linux Kernel Is Now VLA (Variable-Length Array) Free
by nwellnhof on Monday October 29, 2018 @06:17AM
(#18326244)
You don't have to pass void to sizeof explicitly (which, by the way, is an operator, not a macro). The typical use case is arithmetic on void pointers, for example:
void f(void *buf) {
// Clear bytes 10-19
memset(buf + 10, 0, 10);
}
Making void pointers behave like char pointers avoids pointer casts in cases like this.