Skip to content

Dubious bit test in ConsumerRoutingService.cpp #335

@DuncanSands

Description

@DuncanSands

When compiling RTSDK-2.3.2.L1.linux.rrg with g++ 15.2.0, it warns about Ema/Src/Access/Impl/ConsumerRoutingService.cpp line 131: "warning: bitwise comparison always evaluates to true"

And indeed here

                            if ((newDirectory._service.state.flags | RDM_SVC_STF_HAS_ACCEPTING_REQS) != 0)

probably it should be

                            if ((newDirectory._service.state.flags & RDM_SVC_STF_HAS_ACCEPTING_REQS) != 0)

As written, since RDM_SVC_STF_HAS_ACCEPTING_REQS is non-zero, the test indeed always passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions