mntmn / interim

The Interim Operating System
1.24k stars 56 forks source link

Completion of error handling #4

Open elfring opened 8 years ago

elfring commented 8 years ago

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

mntmn commented 8 years ago

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

jeapostrophe commented 8 years ago

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 commented 8 years ago

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

wasamasa commented 7 years ago

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.