[SERVER-36611] Mitigate warnings in gcc-8.2 build Created: 13/Aug/18  Updated: 29/Oct/23  Resolved: 14/Aug/18

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

Type: Improvement Priority: Trivial - P5
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-36653 Add a canary builder for Clang 7 Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2018-08-27
Participants:

 Description   

Server build is noisy with some of the new warnings under gcc-8.2. Particularly when the warnings are emitted by header code, we can apply easy workarounds to increase the signal of the warnings.



 Comments   
Comment by Githook User [ 14/Aug/18 ]

Author:

{'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}

Message: SERVER-36611 warning suppression for gcc-8.2
Branch: master
https://github.com/mongodb/mongo/commit/168c8d65556ab18b05e33b5f4006d1184c30f8f7

Comment by Billy Donahue [ 13/Aug/18 ]

e.g. the `-Wclass-memaccess` warning:

https://logkeeper.mongodb.org/lobster/build/4de23a41348388a858c39423f3e5ea6e/test/5b6b68039041302adb02c7d9#bookmarks=0%2C41631

src/mongo/db/pipeline/value_internal.h: In member function 'mongo::ValueStorage& mongo::ValueStorage::operator=(const mongo::ValueStorage&)':
src/mongo/db/pipeline/value_internal.h:194:42: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'class mongo::ValueStorage' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
 memmove(this, &rhs, sizeof(*this));
 ^
...
src/mongo/db/pipeline/value_internal.h: In member function 'void mongo::ValueStorage::zero()':
src/mongo/db/pipeline/value_internal.h:300:38: warning: 'void* memset(void*, int, size_t)' clearing an object of type 'class mongo::ValueStorage' with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
 memset(this, 0, sizeof(*this));
 ^

 

Generated at Thu Feb 08 04:43:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.