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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
29faa811
Commit
29faa811
authored
May 25, 2020
by
Celelibi
Committed by
Stefan Behnel
May 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid "uninitialised" warnings for sizeof and typeid (GH-3631)
Closes #3575
parent
7ddcdb1e
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 @
29faa811
...
...
@@ -884,6 +884,12 @@ class ControlFlowAnalysis(CythonTransform):
self
.
mark_position
(
node
)
return
node
def
visit_SizeofVarNode
(
self
,
node
):
return
node
def
visit_TypeidNode
(
self
,
node
):
return
node
def
visit_IfStatNode
(
self
,
node
):
next_block
=
self
.
flow
.
newblock
()
parent
=
self
.
flow
.
block
...
...
tests/errors/w_uninitialized.pyx
View file @
29faa811
...
...
@@ -112,6 +112,10 @@ def class_py3k_args():
args
=
[]
kwargs
=
{}
def
uninitialized_in_sizeof
():
cdef
int
i
print
sizeof
(
i
)
_ERRORS
=
"""
6:10: local variable 'a' referenced before assignment
12:11: local variable 'a' might be referenced before assignment
...
...
tests/errors/w_uninitialized_cpp.pyx
0 → 100644
View file @
29faa811
# 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