Ticket #714 (reopened defect)
Misleading warnings: "local variable referenced before assignment"
| Reported by: | nikratio | Owned by: | vitja |
|---|---|---|---|
| Priority: | major | Milestone: | 0.17 |
| Component: | Error Reporting | Keywords: | |
| Cc: | nikratio |
Description
Starting with Cython 0.15, constructions like
def setxattr(path, name, value):
'''Set extended attribute'''
cdef int ret
cdef Py_ssize_t len_
cdef char *cvalue, *cname, *cpath
PyBytes_AsStringAndSize(value, &cvalue, &len_)
#...
produce warnings of the form
warning: /home/nikratio/projekte/llfuse/src/fuse_api.pxi:58:42: local variable 'cvalue' referenced before assignment warning: /home/nikratio/projekte/llfuse/src/fuse_api.pxi:58:49: local variable 'len_' referenced before assignment
...but obviously the code is correct. I'm not sure if warning about uninitialized values when one just passes a pointer to that variable really catches more bugs than it produces false positives.
Change History
Note: See
TracTickets for help on using
tickets.
