Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@connorjward
Copy link
Contributor

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

    preamble_function_qualifier: ClassVar[str] = "static inline"

But I have applied the same logic to other places in the file.

@connorjward
Copy link
Contributor Author

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.

@alexfikl
Copy link
Contributor

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

basedpyright --writebaseline

@alexfikl
Copy link
Contributor

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 :\

@connorjward
Copy link
Contributor Author

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 :\

Yeah I've reverted it. Tried to replicate what your CI does but it didn't seem to work.

@alexfikl
Copy link
Contributor

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
                 }
             },

@connorjward
Copy link
Contributor Author

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!

@inducer inducer enabled auto-merge (squash) July 26, 2025 20:03
@inducer
Copy link
Owner

inducer commented Jul 26, 2025

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...

@inducer inducer merged commit b975e13 into inducer:main Jul 26, 2025
17 checks passed
@connorjward connorjward deleted the connorjward/fix-static-inline branch July 28, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants