Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
int_19h
on Nov 20, 2022
|
parent
|
context
|
favorite
| on:
Mildly interesting quirks of C
Note that:
void foo(int p[static 1]);
is effectively a standard way to declare that p must be non-null pointer. I always wondered if any compiler actually makes use of this for optimization purposes.
eMSF
on Nov 21, 2022
|
next
[–]
Wonder no more: at least clang does, since around v3.5.
https://godbolt.org/z/jEq5xbMna
tristan957
on Nov 21, 2022
|
prev
[–]
If you have a null check on the pointer in the body, GCC will elide it.
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: