Modify

Opened 3 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.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Ion Gaztañaga.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.