github / github/codeql

false positive - cpp/unused-static-function

Đang mở
#11,219 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
acknowledged false-positive
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the false positive**

Every instance of this on the OpenZFS codebase that I have checked appears to be a false positive.

For example, it reports `rrw_enter_read_impl()` is unused, when it is used in `rrw_enter_read()`, which is the next function definition:

https://github.com/ryao/zfs/security/code-scanning/184

The same happens with `abd_fletcher_4_impl()`:

https://github.com/ryao/zfs/security/code-scanning/203

And again with `zfs_rangelock_enter_writer()`, which is used in `zfs_rangelock_enter_impl()`:

https://github.com/ryao/zfs/security/code-scanning/202

Then there is `zfs_rangelock_enter_impl()`, which is used in `zfs_rangelock_enter()`:

https://github.com/ryao/zfs/security/code-scanning/200

zfs_ace_byteswap(), used in `zfs_acl_byteswap()`:

https://github.com/ryao/zfs/security/code-scanning/199

`chksum_run()`, used in `chksum_benchit()`:

https://github.com/ryao/zfs/security/code-scanning/198

`zap_cursor_init_impl()`, used in `zap_cursor_init_serialized()`, `zap_cursor_init()` and `zap_cursor_init_noprefetch()`:

https://github.com/ryao/zfs/security/code-scanning/197

`vdev_indirect_mapping_entry_for_offset_impl()`, used in multiple functions:

https://github.com/ryao/zfs/security/code-scanning/196

`vdev_open_children_impl()`, used in `vdev_open_children()`:

https://github.com/ryao/zfs/security/code-scanning/195

`space_reftree_add_node()`, used in `space_reftree_add_seg()`:

https://github.com/ryao/zfs/security/code-scanning/194

I suspect that all 43 reports are false positives, although so far, I have only explicitly checked about half of them. I have glanced at the ones that I did not explicitly check and I would be very surprised if any of those functions are unused since they are almost entirely important functions in the codebase.

Unused static functions tend to be pruned from the codebase fairly quickly, so I suspect that every report against the OpenZFS codebase is a false positive.

This is probably a duplicate of #10442. However, I figured I would file an issue anyway since the OpenZFS codebase should serve as a decent corpus on which to develop a revised query.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.