Re: ANSI-fy of ranlib, ruptime and rdist [patches]

看板DFBSD_submit作者時間21年前 (2004/07/27 19:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串18/20 (看更多)
Matthew Dillon wrote: > My personal opinion is that we should not make coding/style decisions > based on what linters might complain about, because most linters are really > quite out of date. Also, C is not Java. In all the bugs I've ever found, > I think ignoring a return value (as the cause of a bug) falls so far down > in the noise that it isn't worth worrying about. I didn't mean to argue that the style should go one way or the other; just pointing out the reason for the rule. Personally, it's one that I often break. However, I don't grok your "C is not Java" reasoning. If anything, it's more important to check return values in C due to its lack of exceptions. Also, while not checking a return value is usually not the cause of a bug, it can often provide very useful clues for the onset of a bug. I've had people complain, for example, that an IPC library I wrote isn't working properly, or that it's causing a coredump. Upon closer inspection, they were ignoring the fact that an xxxConnect() call was returning ECONNREFUSED. Maybe we just have sloppier programmers at work? <shrug>
文章代碼(AID): #111Zrm00 (DFBSD_submit)
討論串 (同標題文章)
文章代碼(AID): #111Zrm00 (DFBSD_submit)