Quoth Jordan Brown (Sun) on Tue, Apr 01, 2008 at 03:44:06PM -0700: > Callers should never assume that they know the full list of errors that > a function could return. There might be a favored few that are likely > and have well-documented meanings, but the caller should always be > prepared to handle *any* error return, including error codes that were > not defined when the caller was written. ...
I agree for interfaces across binaries. I disagree for function calls within a file, since I think it's reasonable to expect a programmer who adds an error code to change the callers in that case. It's not clear to me that there's a good generic answer for calls across files of the same binary. It could probably be left to the initial author / architect, though I tend to prefer strict error definitions. Ultimately, perhaps, it depends on our ability to predict the future. David