Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess it's a matter of taste, but I often (not always) prefer less return statements in a function with gotos to error handling/cleanup code. Especially in kernel mode drivers.


Check the asm code generated by your compiler - it may optimize multiple returns into one.


Not performance or code size I'm concerned, it's mainly about correctness. Stuff like input validation and releasing a spinlock in kernel code.




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

Search: