[SERVER-69185] Coverity analysis defect 128675: Macro compares unsigned to 0 Created: 26/Aug/22  Updated: 29/Oct/23  Resolved: 19/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-10-03
Participants:

 Description   

Macro compares unsigned to 0

An unsigned value can never be negative, so this test will always evaluate the same way. An unsigned value can never be less than 0
/src/mongo/db/query/sbe_stage_builder.cpp:1315: NO_EFFECT 128675 This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "slotPos >= 0UL".



 Comments   
Comment by Githook User [ 15/Sep/22 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-69185 Remove redundant size_t >=0 comparison
Branch: master
https://github.com/mongodb/mongo/commit/6045fe2ee565f3eac4cccea8f5ff5aeff6e6f156

Generated at Thu Feb 08 06:12:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.