github / github/codeql

False positive: This expression has no effect (because _function with multiple implementations_ has no external side effects [in incorrectly selected version]).

Open
#20,684 5 comments 0 reactions 0 assignees View on GitHub
C++ false-positive
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**Description of the false positive**

https://github.com/PowerDNS/pdns/pull/16363#discussion_r2455671092

> This expression has no effect (because sendUDPResponse has no external side effects).

codeql appears to have found https://github.com/PowerDNS/pdns/blob/dec9583d885713a0d0ecb55a74ef83cde5f8a235/pdns/dnsdistdist/test-dnsdist_cc.cc#L83 (which is indeed side effect free) instead of https://github.com/PowerDNS/pdns/blob/dec9583d885713a0d0ecb55a74ef83cde5f8a235/pdns/dnsdistdist/dnsdist.cc#L637 (which shouldn't be)

**Code samples or links to source code**

https://github.com/pieterlexis/pdns/blob/064c4c9f2ea60c59d4b0c1a95daad4e17cbe2ce4/pdns/dnsdistdist/dnsdist-udp.cc#L131

https://github.com/PowerDNS/pdns/blob/dec9583d885713a0d0ecb55a74ef83cde5f8a235/pdns/dnsdistdist/test-dnsdist_cc.cc#L83
https://github.com/PowerDNS/pdns/blob/dec9583d885713a0d0ecb55a74ef83cde5f8a235/pdns/dnsdistdist/dnsdist.cc#L637

**URL to the alert on GitHub code scanning (optional)**

I don't have access to this, but I'll see if I can get someone to provide it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.