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
Gwenaël Samain
cython
Commits
5bc9ddec
Commit
5bc9ddec
authored
May 01, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
suppress warnings about unused error status variables in functions
parent
5a02cdcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+9
-3
No files found.
Cython/Compiler/Code.py
View file @
5bc9ddec
...
...
@@ -501,6 +501,7 @@ class FunctionState(object):
# However, exceptions may need to be propagated through '
nogil
'
# sections, in which case we introduce a race condition.
self.should_declare_error_indicator = False
self.uses_error_indicator = False
# labels
...
...
@@ -1625,10 +1626,14 @@ class CCodeWriter(object):
self
.
putln
(
"%s%s;"
%
(
static
and
"static "
or
""
,
decl
))
if
func_context
.
should_declare_error_indicator
:
if
self
.
funcstate
.
uses_error_indicator
:
unused
=
''
else
:
unused
=
'CYTHON_UNUSED '
# Initialize these variables to silence compiler warnings
self
.
putln
(
"
int %s = 0;"
%
Naming
.
lineno_cname
)
self
.
putln
(
"
const char *%s = NULL;"
%
Naming
.
filename_cname
)
self
.
putln
(
"
int %s = 0;"
%
Naming
.
clineno_cname
)
self
.
putln
(
"
%sint %s = 0;"
%
(
unused
,
Naming
.
lineno_cname
)
)
self
.
putln
(
"
%sconst char *%s = NULL;"
%
(
unused
,
Naming
.
filename_cname
)
)
self
.
putln
(
"
%sint %s = 0;"
%
(
unused
,
Naming
.
clineno_cname
)
)
def
put_h_guard
(
self
,
guard
):
self
.
putln
(
"#ifndef %s"
%
guard
)
...
...
@@ -1975,6 +1980,7 @@ class CCodeWriter(object):
Naming
.
lineno_cname
,
Naming
.
filename_cname
,
)
self
.
funcstate
.
uses_error_indicator
=
True
self
.
putln
(
'__Pyx_AddTraceback("%s", %s, %s, %s);'
%
format_tuple
)
def
put_trace_declarations
(
self
):
...
...
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