[SERVER-56585] deprecate MONGO_COMPILER_VARIABLE_UNUSED in favor of C++ 17 attributes maybe_unused Created: 03/May/21  Updated: 29/Oct/23  Resolved: 05/May/21

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

Type: Improvement Priority: Trivial - P5
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 1
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-55977 Coverity analysis defect 118057: Unch... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-05-17
Participants:
Story Points: 1

 Description   

We have been using the C++ 17 attribute maybe_unused in the server code base for a while now (earliest detected usage was in SERVER-40312 in 4.2). It may be time to retire the MONGO_COMPILER_VARIABLE_UNUSED macro.

https://github.com/mongodb/mongo/search?q=maybe_unused&type=Code

https://github.com/mongodb/mongo/search?q=MONGO_COMPILER_VARIABLE_UNUSED&type=Code



 Comments   
Comment by Githook User [ 05/May/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-56585 remove MONGO_COMPILER_VARIABLE_UNUSED macro

This macro is no longer necessary now that we have [[maybe_unused]].
Branch: master
https://github.com/mongodb/mongo/commit/509c3958e7e3fa57e6d2aeb359bd9130318b74ba

Comment by Githook User [ 05/May/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-56585 IDL generator uses c++17 attribute maybe_unused
Branch: master
https://github.com/mongodb/mongo/commit/348c7bf8615412ea2676c6339ba1b5a556c3ba2e

Comment by Githook User [ 04/May/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-56585 replace MONGO_COMPILER_VARIABLE_UNUSED with c++17 attribute maybe_unused (.cpp files only)
Branch: master
https://github.com/mongodb/mongo/commit/e17313d141f04ef1cb05d290fcdf1fdbbcaa231c

Comment by Benety Goh [ 04/May/21 ]

This issue was raised while reviewing SERVER-55977.

Generated at Thu Feb 08 05:39:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.