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

WT-2691 Use wrappers for ctype functions to avoid sign extension errors #2818

Merged
merged 4 commits into from
Jun 22, 2016

Conversation

ddanderson
Copy link
Member

Create _wt* versions of all ctype functions, and use them whenever wt_internal.h is available. Add check to prevent direct use of type functions from core source.

This is an alternative to simply banning the use of plain 'char', as in #2783.

…rors.

Create __wt_* versions of all ctype functions, and use them whenever
wt_internal.h is available.  Add check to prevent direct use of ctype functions
from core source.
@ddanderson
Copy link
Member Author

@keithbostic, can you review please?

@ddanderson ddanderson changed the title WT-2691 Cast arguments for ctype functions to avoid sign extension errors WT-2691 Use wrappers for ctype functions to avoid sign extension errors Jun 21, 2016
__wt_iscntrl(int c)
{
return iscntrl((unsigned char)c);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider omitting unused wrapper until we need them.

@ddanderson
Copy link
Member Author

@michaelcahill, thanks for the comments, please merge if this resolves them.

@@ -599,7 +600,7 @@ config_opt_file(CONFIG *cfg, const char *filename)
rtrim = comment;

/* Skip trailing space again. */
while (rtrim > ltrim && isspace(rtrim[-1]))
while (rtrim > ltrim && isspace((unsigned char)rtrim[-1]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddanderson, I'd suggest using u_char.

@keithbostic
Copy link
Contributor

@ddanderson, lgtm, merge at will as far as I'm concerned.

@ddanderson
Copy link
Member Author

self reviewing this last bit, and merging.

@ddanderson ddanderson merged commit f782f62 into develop Jun 22, 2016
@michaelcahill michaelcahill deleted the wt-2691-ctype branch June 29, 2016 04:15
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.

3 participants