Cast a void pointer to char* before subtracting it#5034
Merged
JackStouffer merged 1 commit intodlang:masterfrom Jan 15, 2017
LemonBoy:correct-cast
Merged
Cast a void pointer to char* before subtracting it#5034JackStouffer merged 1 commit intodlang:masterfrom LemonBoy:correct-cast
JackStouffer merged 1 commit intodlang:masterfrom
LemonBoy:correct-cast
Conversation
dukc
approved these changes
Jan 14, 2017
Contributor
There was a problem hiding this comment.
I would think int* and void* should cast the int* implicitly to void*, but according to that bug spec the first value is cast to type of the second, which is indeed dangerous. So yes, I think it should be forbidden as the docs say. If nothing else, to avoid silent breakage.
And I assume that this has to be pulled for that DMD fix to work. Let's do it, shall we?
Contributor
|
@LemonBoy Codecov is complaining; can you please manually verify that the line changed is covered? Thanks |
Contributor
Author
|
Looks like the those lines weren't covered even before this patch, what should I do? |
Contributor
|
@LemonBoy Please add a unit test |
Contributor
Author
|
Well, I tried |
Contributor
|
Huh, must be a coverage bug. |
Contributor
|
Auto-merge toggled on |
JackStouffer
approved these changes
Jan 15, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See DMD's PR