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

I wish they had replaced the - operator since many error codes contain a minus and it's easier to type -2081 than "-2081".


Why would an error code be negative?


It's a matter of conventions. Look at Linux kernel for instance. Error codes are positive, but if function is returning error, then return code is -error, i.e. negative and it's pretty sensible solution. Mind that in case of syscalls, errno stuff comes from glibc, which wraps syscalls to set errno and return -1. So searching for -error is not something awkward, but, as stated earlier, you have to quote it in google to make it work.


Good question. Labeling. Sometimes I get odd errors from crashed applications which read error code "-538", for example. Looking for error code 538 can lead to the error I was looking for but also for other 538s not equal to "-538".




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

Search: