Pelles C forum

Pelles C => Bug reports => Topic started by: ika on September 10, 2018, 03:34:55 AM

Title: set errno when incorrect mode string is passed to fopen
Post by: ika on September 10, 2018, 03:34:55 AM
If you pass "rt" and "wt" (this is a Microsoft extension) to fopen in Pelles C 8, this does not cause any problems. However in Pelles C 9 it returns NULL. Of course "rt" and "wt" are nonstandard, so that isn't a problem, but errno is never set. So I didn't know what was wrong for a while, because while "strerror(errno)" says "no error", it is an error, which is why it returns NULL. So, I think it would be helpful for an error number and message to be added to strerror about passing in an incorrect mode string.
Title: Re: set errno when incorrect mode string is passed to fopen
Post by: Pelle on September 16, 2018, 07:37:21 PM
So, more of a feature request really? Yes, seems reasonable (will most likely be EINVAL).
Title: Re: set errno when incorrect mode string is passed to fopen
Post by: ika on September 17, 2018, 02:02:49 AM
Yeah, you're right that I put this in the wrong forum. Thanks for the response!