diff options
author | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-28 00:37:04 +0300 |
---|---|---|
committer | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-28 00:37:04 +0300 |
commit | 63c7adae262ecbdf9401837812f0709c19a749bb (patch) | |
tree | 3ca8bb987d97943fd17ab960501dc02e98dfeca5 | |
parent | 0992c63ef803ae02d2d048f6b3097422dac89323 (diff) | |
download | cython-dalcinl/mark-unused-vars.tar.gz |
Mark unused vars with `(void)x;` [should silence Coverity Scan]dalcinl/mark-unused-vars
-rw-r--r-- | Cython/Compiler/Nodes.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 3771f95fa..eb933fc77 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -6819,7 +6819,8 @@ class TryExceptStatNode(StatNode): else: # try block cannot raise exceptions, but we had to allocate the temps above, # so just keep the C compiler from complaining about them being unused - save_exc.putln("if (%s); else {/*mark used*/}" % '||'.join(exc_save_vars)) + mark_vars_used = ["(void)%s;" % var for var in exc_save_vars] + save_exc.putln("%s /* mark used */" % ' '.join(mark_vars_used)) def restore_saved_exception(): pass |