Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
e41c71a6
Commit
e41c71a6
authored
May 25, 2020
by
Celelibi
Committed by
GitHub
May 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid "uninitialised" warnings for sizeof and typeid (GH-3631)
Closes #3575
parent
d2d29932
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
Cython/Compiler/FlowControl.py
Cython/Compiler/FlowControl.py
+6
-0
tests/errors/w_uninitialized.pyx
tests/errors/w_uninitialized.pyx
+4
-0
tests/errors/w_uninitialized_cpp.pyx
tests/errors/w_uninitialized_cpp.pyx
+12
-0
No files found.
Cython/Compiler/FlowControl.py
View file @
e41c71a6
...
@@ -885,6 +885,12 @@ class ControlFlowAnalysis(CythonTransform):
...
@@ -885,6 +885,12 @@ class ControlFlowAnalysis(CythonTransform):
self
.
mark_position
(
node
)
self
.
mark_position
(
node
)
return
node
return
node
def
visit_SizeofVarNode
(
self
,
node
):
return
node
def
visit_TypeidNode
(
self
,
node
):
return
node
def
visit_IfStatNode
(
self
,
node
):
def
visit_IfStatNode
(
self
,
node
):
next_block
=
self
.
flow
.
newblock
()
next_block
=
self
.
flow
.
newblock
()
parent
=
self
.
flow
.
block
parent
=
self
.
flow
.
block
...
...
tests/errors/w_uninitialized.pyx
View file @
e41c71a6
...
@@ -112,6 +112,10 @@ def class_py3k_args():
...
@@ -112,6 +112,10 @@ def class_py3k_args():
args
=
[]
args
=
[]
kwargs
=
{}
kwargs
=
{}
def
uninitialized_in_sizeof
():
cdef
int
i
print
sizeof
(
i
)
_ERRORS
=
"""
_ERRORS
=
"""
6:10: local variable 'a' referenced before assignment
6:10: local variable 'a' referenced before assignment
12:11: local variable 'a' might be referenced before assignment
12:11: local variable 'a' might be referenced before assignment
...
...
tests/errors/w_uninitialized_cpp.pyx
0 → 100644
View file @
e41c71a6
# cython: warn.maybe_uninitialized=True
# mode: error
# tag: cpp, werror
from
cython.operator
import
typeid
def
uninitialized_in_typeid
():
cdef
int
i
print
typeid
(
i
)
==
typeid
(
i
)
_ERRORS
=
"""
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment