-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 build with clang 13 #60328
Fix build with clang 13 #60328
Conversation
Tested with: ```sh $ clang --version | head -1 Ubuntu clang version 13.0.0-++20211006103153+fd1d8c2f04dd-1~exp1~20211006223759.3 ```
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsTested with: $ clang --version | head -1
Ubuntu clang version 13.0.0-++20211006103153+fd1d8c2f04dd-1~exp1~20211006223759.3 Fixes #60326.
|
cc @lambdageek, I have tested libs.native+clr+host.native. |
`cast from 'void (*)(int, siginfo_t *, void *)' to 'void (*)(int)' converts to incompatible function type` But going through an intermediate `void (*) (void)` function type is allowed.
@@ -10912,7 +10912,7 @@ GenTree* Compiler::fgMorphCastedBitwiseOp(GenTreeOp* tree) | |||
// tree op1 | |||
// / \ | | |||
// op1 op2 ==> tree | |||
// | | / \ | |||
// | | / \. |
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.
unintentional change?
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.
Ah this is to tell the compiler that the backslash at the end of the line is ok: #56281 (comment)
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.
It fixes the gcc build failure which was introduced by 68042e1 (failing on other PRs atm). basically gcc doesn't like single-line comment ending with \ so we put period at the end or convert it to a block comment /**/ instead of //
search \.
in morph.cpp to see other places where we fix the same thing in the past.
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.
Just saw your second comment.
(everything on PR page is loaded asynchronously except for the review comment 🤷)
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.
I merged #60333 which fixes this as well.
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.
Ah, couple of years back 5bac01a#diff-4fc9b329f498a5462a489299cbdb038dfcb00c1fe30864ccb950e80461238fbb fixed this error by either using multi-line comments:
// good.cpp
/*
tree
\
X
*/
or putting a period after trailing backslash if someone prefers single line comments:
// also-good.cpp
// tree
// \.
// X
nesting single-line comments in multi-line ones wasn't necessary and can be deleted.
* Fix build with clang 13 Tested with: ```sh $ clang --version | head -1 Ubuntu clang version 13.0.0-++20211006103153+fd1d8c2f04dd-1~exp1~20211006223759.3 ``` * Fix gcc build * Unify supressions * Fix Clang 13 -Wcast-function-type warning `cast from 'void (*)(int, siginfo_t *, void *)' to 'void (*)(int)' converts to incompatible function type` But going through an intermediate `void (*) (void)` function type is allowed. Co-authored-by: Aleksey Kliger <[email protected]>
Tested with:
$ clang --version | head -1 Ubuntu clang version 13.0.0-++20211006103153+fd1d8c2f04dd-1~exp1~20211006223759.3
Fixes #60326.