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

The arguments to isxxxx() and family must give well-defined results. #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

he32
Copy link

@he32 he32 commented Dec 21, 2018

In other words, it must either be EOF or a value representable by an
unsigned char. Here we simply cast all the arguments to these functions
to "unsigned char".

In other words, it must either be EOF or a value representable by an
unsigned char.  Here we simply cast all the arguments to these functions
to "unsigned char".
@tobez
Copy link
Owner

tobez commented Aug 9, 2023

Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?

@he32
Copy link
Author

he32 commented Sep 29, 2023

Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?

Possibly. However, EOF cannot be represented in an unsigned char, so if you need to test for EOF that needs to be done before the returned data is passed on. I've not looked at whether that would make the diff smaller or the code simpler.

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

Successfully merging this pull request may close these issues.

2 participants