Hacker News

Favorites Setup
Comment by mr_00ff00 | original | C for Rust programmers
[−]mr_00ff00 · 2026-10-10 Sat 14:28 UTC · link
All fun and games with arrays being pointers, until you declare an array in a function and return it.
[−]jackling · 2026-10-10 Sat 14:36 UTC · link
Isn't this easily catchable with static analysis, -Werror -Wall? I've never had a practical problem with this.

Also arrays aren't pointers in C, they decay into pointers. You can see this since sizeof will work differently in the function that instantiates the array versus one that takes in the pointer as a parameter.