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
cortex-m: fix warning about volatile keyword in incorrect position #2043
Conversation
There are a few other issues here too, namely that not all of the assembly blocks properly specify their clobbers (#2037) -- it would be good to fix all of this while we're here if we can. |
Okay, I pushed a commit that I think fixes a number of issues with the cortex-m clobbers. I could have made some mistakes though, as I am hardly an inline assembly expert. The fixes can be summarized as follows:
I tried to match the changes to cortex-m4 and cortex-m3. I did not touch cortex-m0. Someone checking my work would be appreciated. |
Arg can we merge this into #2027? I don't know how we're going to keep all of this straight. |
This looks fine to me (but I'm no expert), but I would rather see a more comprehensive review happen with a switch to llvm_asm to asm. |
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.
Huh, TIL about the cc
and memory
clobbers; neat.
I think we need memory
clobbers wherever we're doing str
's IIUC the documentation correctly.
Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com>
Yeah, agreed about the
|
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.
This looks good to me now
bors r+ |
Pull Request Overview
#2002 added a volatile keyword in the position intended for clobbers in the assembly responsible for resetting the stack pointer.
This surfaced a warning whenever compiling a cortex-m4 architecture, but this warning did not cause CI to fail because
cd arch/ && RUSTFLAGS="-D warnings" cargo test
ignores code that can't be compiled on the host platform, and we do not deny warnings when compiling all boards.Testing Strategy
This pull request was tested by compiling Imix and seeing that the warning is gone.
TODO or Help Wanted
Ideally we would deny warnings in
ci-job-compilation
so mistakes like this couldn't slip past CI, but passingRUSTFLAGS="-D warnings"
to the call tomake allboards
withinci-job-compilation
did not seem to work, and I did not try anything further.Documentation Updated
Formatting
make prepush
.