Skip to content

Coverity: fix or annotate the outstanding untriaged defects - #136

Open
jll63 wants to merge 9 commits into
boostorg:developfrom
jll63:fix/coverity
Open

jll63 wants to merge 9 commits into
boostorg:developfrom
jll63:fix/coverity

Conversation

@jll63

@jll63 jll63 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

(Written by Claude Code, on behalf of @jll63.)

Addresses the untriaged Coverity Scan defects in openmethod's own code.

Fixed in code

  • 506031: minimal_cover tracks the best bit as a mask, not an int that starts at -1 and is shifted
  • 504989: default_error_handler::set moves the previous handler out instead of copying it
  • 504988, 504991: find_lib binds the directory entry by reference
  • 505813, 490469: test_slot_allocator moves from the last use

Annotated as false positives

  • 504986: error() copies the handler on purpose, because the handler may call set()
  • 504987: method::fn, whose constructor uses only zero- or constant-initialized statics
  • 504992: the one-past-the-end pointer in class_info::type_id_end()
  • 506030, 505810–505812, 505814–505817, 490457: tests that check a moved-from object on purpose
  • 490461, 490475, 501245: tests of the non-const lvalue copy overload

Excluded from the Coverity build

  • 505640, 505641: test/Jamfile skips the compile_fail_* tests when COVERITY_SCAN_TOKEN is set, which Boost.CI does only in its Coverity step. CMake and normal b2 runs are unchanged.

The coverity[...] tags are inferred from the checker names, so I'll confirm them on the next scan. The CSV had no line for 504987, 490461, 490475 or 501245, so those placements are my best match. All 218 CMake tests pass in build-std.

🤖 Generated with Claude Code

jll63 and others added 9 commits October 19, 2026 16:43
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The conditional expression copied it; return it by implicit move instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_end

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…arts at -1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The tests that check a moved-from object do so on purpose: annotate the
first use after each move. Move from the last use in test_slot_allocator.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rity step

Boost.CI sets COVERITY_SCAN_TOKEN only there. Coverity analyzes the
half-parsed translation units of tests meant not to compile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…copy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://136.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-10-19 21:11:14 UTC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants