Skip to content
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

Completion of error handling #4

Open
elfring opened this issue Sep 16, 2015 · 4 comments
Open

Completion of error handling #4

elfring opened this issue Sep 16, 2015 · 4 comments

Comments

@elfring
Copy link

elfring commented Sep 16, 2015

Would you like to add more error handling for return values from functions like the following?

@mntmn
Copy link
Owner

mntmn commented Sep 20, 2015

I don't really understand what this issue is exactly about, sorry. Please rephrase.

@jeapostrophe
Copy link
Contributor

I think it means that the call to seek in posixfs_open doesn't check the return code and same for malloc in main and printf in init_compiler

@elfring
Copy link
Author

elfring commented Sep 21, 2015

I suggest to avoid ignorance of return values a bit more.
Would you like to detect every error situation as early as possible?

@wasamasa
Copy link
Contributor

Personally, I believe that error checking printf is a tad overkill, with snprintf however a must. Perhaps malloc could be replaced with something like xmalloc (which exits if malloc threw an error because, well, there isn't much else you can do in that situation).

Other than that, more error handling in file and string functions would be great and if possible/sensible, the use of safer string functions. There's at least one occurrence of improperly null-terminated strings in the sources, for that pervasive use of snprintf would be a good idea (combined with a warning if the limit is exceeded). I'll have to investigate what the situation with strlen, strcpy and strcmp is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants