-
Notifications
You must be signed in to change notification settings - Fork 79
Prefer 'static inline' to 'inline' for C functions #948
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
Prefer 'static inline' to 'inline' for C functions #948
Conversation
Just passing 'inline' is undefined behaviour and leads to linker failures. See https://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file/16245669#16245669.
|
I don't quite know what has caused the pyright failure. I'm hoping you will be able to advise me on how to fix it. |
From a quick skim, that function is untyped and probably already had an error that got baselined. You just need to update it for the new line/column numbers using |
Hm, apparently that made things worse, sorry! Not quite sure how this baselining thing works with different environments.. I'm guessing you have slightly different versions of things than the CI and it got confused :\ |
This reverts commit 0e45e10.
Yeah I've reverted it. Tried to replicate what your CI does but it didn't seem to work. |
This fixes it for me locally, so fingers crossed :\ diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json
index cf31cdf6..9e61a779 100644
--- a/.basedpyright/baseline.json
+++ b/.basedpyright/baseline.json
@@ -69166,8 +69166,8 @@
{
"code": "reportUnknownMemberType",
"range": {
- "startColumn": 32,
- "endColumn": 43,
+ "startColumn": 39,
+ "endColumn": 50,
"lineCount": 1
}
},
|
That worked. Thanks! |
|
Thanks! One thing I do want to say is that my expectation as far as type checking is concerned is that the baseline shrinks with changes, so I'm not really super interested in patching it to keep the linter happy. In this case, it took minimal effort (IMO?) to type those two functions, likely way easier than fiddling with column indices... |
Just passing 'inline' is undefined behaviour and leads to linker failures.
See https://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file/16245669#16245669.
The change that fixed the issue I was encountering was here
But I have applied the same logic to other places in the file.