-
Notifications
You must be signed in to change notification settings - Fork 7.8k
crypt_sha256/crypt_sha512, fix build with more recent versions of cla… #8897
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
Conversation
0d6150d
to
aa8b9b9
Compare
I noticed this warning when compiling with Clang but I'm not sure how to fix it and if pragmas are desirable, and because this is security related code I'm far from confident to touch it, so I suppose the pragmas are OK |
Yes since it s well based on the glibc implementation, I did not want to touch it neither. |
Undefined behavior is a serious issue, and I don't think we should suppress such warnings, if they are legit, and I think in this case they are. Instead of subtracting a NULL pointer, shouldn't we just cast to |
It appears even tough the related glibc code had been like this forever (even now). Ok will give a try then. |
… casting instead. While at it fixing werror level on phpdbg too.
aa8b9b9
to
d83ec6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the PHPDBG changes present in the previous PR as well?
Nope :-) |
use the old custom alloca.
@devnexen, there have been some issues with the branches, and apparently this fix is no longer in "master" now. I assume it should be applied there as well, but you had reverted. Do we need to re-apply? |
Yes I redid a new PR just for master |
…ng (> 11).
clang picks up the address subtraction to null as UB, but the implementations
are based on glibc.
error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] if ((key - (char *) 0) % __alignof__ (uint64_t) != 0) {