Hacker News new | past | comments | ask | show | jobs | submit login

Good to see the list is short and relatively sane compared to other "banned function" lists. Unfortunately, "too easy to misuse" is a slippery slope, and gets(), which is probably the best example of a function which is really broken by design, isn't on that list.

I'm surprised that "complicate audits" is given as a reason, because isn't this something static analysers (and I mean ones that actually analyse data/code flow, not dumb pattern-matchers) can easily detect? It's really just asking the question "how long is this/can this be" and following the data back to its origin(s).




As per ISO C11 standard, compliant compilers no longer need to support gets().


C aliasing rules can very quickly make "following the data back to its origin" very difficult.


Theoretically it's equivalent to the Halting Problem, but in practice I've not seen such difficulty; if aliasing does become a problem to the extent that following dataflow is difficult, I suspect there are already far deeper design flaws in the codebase.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: