New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check return codes everywhere #5350
Comments
Comment author: @elfring I suggest to avoid unchecked function calls. Another update candidate: |
Comment author: @lefessan "lseek" would indeed need a fix, but the other functions are mostly debug functions, where error handling is not important. |
Comment author: @elfring How do you think about a topic like "How to raise warning if return value is How do you think about to apply aspect-oriented software development? |
Comment author: dsheets The return code lseek in read_trailer will never matter as the immediately subsequent read call will always fail if the lseek fails. This will result in a BAD_BYTECODE error. Is there an actual error in the compiler that results from an unchecked return code that has turned up? Without a bug reproduction or a listing of questionable code locations, I think this bug should be closed. |
Comment author: @xavierleroy Added check for lseek() in read_trailer(). (Commits r13959 in version/4.01 and r13960 in trunk.) I agree with dsheets that it's not really necessary, but the code is clearer this way. Debug printf's don't need checks. |
Original bug ID: 5350
Reporter: @elfring
Status: closed (set by @xavierleroy on 2015-12-11T18:21:22Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.1
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
Some checks for return codes are missing.
Examples:
Would you like to add more error handling for return values from "lseek" like in the function "read_trailer" and from "fprintf" in the function "caml_trace_value_file"?
Additional information
http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/trunk/byterun/startup.c?rev=11156&view=auto
http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/trunk/byterun/instrtrace.c?rev=11156&view=auto
The text was updated successfully, but these errors were encountered: