-
Notifications
You must be signed in to change notification settings - Fork 28
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 const-window argument passing #288
Conversation
@@ -66,8 +70,8 @@ struct exo_win_2i8c{ | |||
const int8_t * const data; | |||
const int_fast32_t strides[2]; | |||
}; | |||
struct exo_win_3i8c{ | |||
const int8_t * const data; | |||
struct exo_win_3i8{ |
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.
In this test and the others, these structs aren't actually used anywhere. I'm guessing they come from instr signatures, but I'm not totally sure.
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 curious, was there any warning or performance consequence from not having const?
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.
Nothing we rigorously measured. But there are still a great many reasons for having const.
- Having
const
enables the C compiler to check our generated code. If we misplace a const the C compiler will warn or error, and that means our analysis somewhere is wrong. This helps us catch bugs. - Having accurate
const
information makes it easier to integrate into existing C codebases. For instance, someone might have a const-qualified buffer in their program. They would have to cast away that const to call an Exo function. That's a recipe for unexpected / undefined behavior.
and so on...
Codecov Report
@@ Coverage Diff @@
## master #288 +/- ##
=======================================
Coverage 87.91% 87.92%
=======================================
Files 72 72
Lines 15632 15652 +20
=======================================
+ Hits 13743 13762 +19
- Misses 1889 1890 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM, thanks!
Discovered at the Hackathon yesterday. We don't have enough tests that stress parameter passing, which is why this wasn't caught in the first place...