[SERVER-54282] -Wunused-result shouldn't ignore --disable-warnings-as-errors Created: 04/Feb/21  Updated: 29/Oct/23  Resolved: 19/Feb/21

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Ryan Egesdahl (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2021-02-22
Participants:

 Description   

We are currently forcing clang builds (and only clang builds) to use -Werror=unused-result (https://github.com/mongodb/mongo/blob/master/SConstruct#L2388-L2389) which ignores the --disable-warnings-as-errors. I always generate my compile_commands.json with that flag so that my editor shows errors and warnings differently.



 Comments   
Comment by Githook User [ 19/Feb/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-54282 Honor --disable-warnings-as-errors for unused results

We should not make any compiler warnings cause errors if
`--disable-warnings-as-errors` was given, so we condition the one
instance where we weren't, `--Werror=unused-result`, conditioned upon
it.
Branch: master
https://github.com/mongodb/mongo/commit/c4088911e4347147c11bc3c2fb29e4f562dd7f66

Comment by Andrew Morrow (Inactive) [ 04/Feb/21 ]

Yeah, I agree it should be conditioned on the state of --disable-warnings-as-errors.

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