Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RULE-25-21, others: Consider something like a library TracesToExplicit<T> #848

Open
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-LowenhancementNew feature or request
@MichaelRFairhurst

Description

@MichaelRFairhurst

Affected rules

  • RULE-25-21
  • Likely others, haven't researched

Description

Rule25-21 requires that theatomic_*_explicit operations use the memory ordermemory_order_seq_cst.

It would probably be overly restrictive to require an explicit inline writtenmemory_order_seq_cst at the call site. However, it's probably too accepting to merely allow any dynamically computed value. Ideally, we can support basic indirection like variable assignment, parameter values, function calls/returns, and report cases that don't trace back to an acceptable root.

Doing this as a typical flow analysis is backwards. We can easily track flow frommemory_order_seq_cst exprs toatomic_*_explicit calls, but the existence of such a flow doesn't preclude that invalid values also flow to the call. Alternatively, there are potential performance issues if we considerall exprs which are notmemory_order_seq_cst to be sources in the flow analysis.

Wouldn't be terribly hard to write a library such asTracesToExplicit<T> that is a very simple global flow analysis made for this purpose, starting from sinks and doing only very obvious backwards tracking of values through function calls and variable assignments. If that doesn't track back to an acceptable value, we can report it. Ideally we can report it as apath-problem though this makes such a library more complex to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-LowenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp