Timeline for Should I always return an error code from C functions?
Current License: CC BY-SA 3.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
| Oct 9, 2015 at 1:41 | answer | added | Caleth | timeline score: 1 | |
| Mar 18, 2015 at 9:33 | history | tweeted | twitter.com/#!/StackProgrammer/status/578126981667168256 | ||
| Mar 17, 2015 at 13:58 | comment | added | Clockwork-Muse |
Side note - time ranges, like all positive contiguous-range types, should have an inclusive lower-bound (that is, >=). The upper-bound should still be exclusive, though.
|
|
| Mar 17, 2015 at 13:11 | vote | accept | juhist | ||
| Mar 17, 2015 at 11:08 | answer | added | Doc Brown | timeline score: 5 | |
| Mar 17, 2015 at 10:34 | comment | added | Brandin |
If you're using GCC there is a nonnull attribute which may help you catch the error you're talking about (passing a null pointer when this is not allowed by the function). And in general you can use assert to catch errors that logically shouldn't happen (i.e. if an assert failed it's because the programmer messed up)
|
|
| Mar 17, 2015 at 10:17 | history | edited | gnat | CC BY-SA 3.0 |
formatting kaizen
|
| Mar 17, 2015 at 10:10 | history | edited | juhist | CC BY-SA 3.0 |
Add link to related question in stackoverflow and some discussion which justifies this is a different question
|
| Mar 17, 2015 at 10:03 | comment | added | gnat | I see, thanks. Consider editing the question here to help readers find related one at SO and better understand how it is different from one posted here | |
| Mar 17, 2015 at 9:59 | comment | added | juhist | Yes, I agree there is a lot of overlap between these two questions and I came up with both in the same discussion with team members. Nevertheless, I still think this is a different question. This question is about whether it is a good idea to return something else than an error code, whereas the other question is about whether I should crash the program with coredump or print a meaningful error message if a "can't never happen" error happens. I think if you read the questions carefully, you'll note that they are indeed different questions. | |
| Mar 17, 2015 at 9:51 | comment | added | gnat | how is this different from question you posted at Stack Overflow? | |
| Mar 17, 2015 at 9:36 | review | First posts | |||
| Mar 17, 2015 at 12:50 | |||||
| Mar 17, 2015 at 9:34 | history | asked | juhist | CC BY-SA 3.0 |