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

Fix static code analysis warnings in Visual Studio 2019 #99

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

ScottHutchinson
Copy link
Contributor

Fix the three warnings below. This fixes Issue #88 (noexcept). Not sure if the signed/unsigned char fix is ok for platforms other than Windows.

Utilities\DxFileUtility\DxFileUtility\args.hxx (232, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(232,0): Warning C6330: 'char' passed as Param(1) when 'unsigned char' is required in call to 'isspace'.
Utilities\DxFileUtility\DxFileUtility\args.hxx (466, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(466,0): Warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
Utilities\DxFileUtility\DxFileUtility\args.hxx (2021, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(2021,0): Warning C6330: 'char' passed as Param(1) when 'unsigned char' is required in call to 'isspace'.

Fix the three warnings below. This fixes Issue Taywee#88 (noexcept). Not sure if the signed/unsigned char fix is ok for platforms other than Windows.

Utilities\DxFileUtility\DxFileUtility\args.hxx (232, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(232,0): Warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isspace'.
Utilities\DxFileUtility\DxFileUtility\args.hxx (466, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(466,0): Warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
Utilities\DxFileUtility\DxFileUtility\args.hxx (2021, 0)
Utilities\DxFileUtility\DxFileUtility\args.hxx(2021,0): Warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isspace'.
@Taywee
Copy link
Owner

Taywee commented Jul 9, 2021

Thank you for the PR. I'm not a fan of the unsigned char in the for loop. I don't think it will cause any platform problems and should perform fine, but it is something that sticks out as odd without a comment explaining the case, and might unwittingly be changed back by some future cleanup. I'll pull the PR and add a comment (and maybe also change the loop variable to an auto and just throw a static_cast on isspace for extra clarity).

@Taywee Taywee merged commit 01ac825 into Taywee:master Jul 9, 2021
@ScottHutchinson
Copy link
Contributor Author

Sounds good. Thanks!

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