Hacker News new | ask | show | jobs
by flohofwoe 1463 days ago
Static analyzers can catch this stuff nowaways (in this case clang's builtin analyzer):

https://godbolt.org/z/1MfErrYd8

...in more simple cases it's also a regular warning:

https://godbolt.org/z/5v9YsWd4j