Opened 4 years ago

#10848 new Bugs

try_acquire_file_lock/ try_acquire_file_lock_sharable uses = instead of == in comparison

Reported by: Steve Hickman <steve.hickman@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

The last line for both try_acquire_file_lock and try_acquire_file_lock_sharable is:

return (acquired = true);

It is unclear if the use of assignment ('=') instead of comparison ('==') here is intentional. My static analysis checker picked it up as a bug. If this is intentional, it should be documented with comments inline. Or, better yet, split into 2 lines of code so static analysis doesn't flag it.

Change History (0)

Note: See TracTickets for help on using tickets.