[SERVER-28691] warning C4373: 'mongo::Collection::aboutToDeleteCapped': virtual function overrides 'mongo::CappedCallback::aboutToDeleteCapped' Created: 07/Apr/17  Updated: 06/Dec/17  Resolved: 20/Apr/17

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

Type: Bug Priority: Minor - P4
Reporter: Kaloian Manassiev Assignee: ADAM Martin (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2017-05-08
Participants:

 Description   

The following warning exists in collection.h:

E:\workspace\mongo\src\mongo/db/catalog/collection.h(726): warning C4373: 'mongo::Collection::aboutToDeleteCapped': virtual function overrides 'mongo::CappedCallback::aboutToDeleteCapped', previous versions of the compiler did not override when parameters only differed by const/vol
atile qualifiers
E:\workspace\mongo\src\mongo/db/storage/capped_callback.h(53): note: see declaration of 'mongo::CappedCallback::aboutToDeleteCapped'

I believe it is not necessary to have aboutToDeleteCapped in the Collection class.



 Comments   
Comment by Githook User [ 20/Apr/17 ]

Author:

{u'username': u'adamlsd', u'name': u'ADAM David Alan Martin', u'email': u'adam.martin@10gen.com'}

Message: SERVER-28691 Disable MSVC warning C4373

The MSVC compiler has warnings which alert users that the behavior
of the compiler has changed. In the case of C4383, the compiler
used to have non-conforming behavior to C++98. At some point this
behavior was fixed. MongoDB's code base should not have any code
which would be adversely affected by this change, as the code is
also compiled on platforms where the native compiler is conformant
to the standard in this point. Therefore it should be safe to
disable this warning.

The specific warning cautions that a derived class's inline
definition of a virtual function will now override a parent's
implementation, where formerly it would not. This would happen
when the derived class's implementation specified at least one
of the parameters `const` (in such a way that the actual signature
of the function isn't changed). MSVC incorrectly determines that
if there are two functions that differ only in a non-observable
`const` specifier, then they would have different signatures, in
many circumstances. This would mean that the compiler resorts to
treating such functions as overloads. The compiler now behaves
correctly for the case of override in a derived class; however,
it issues a warning. The warning is irrelevant to us.
Branch: master
https://github.com/mongodb/mongo/commit/4d6ac4793f023dfc7b393068ee14f6425fe7e3d2

Comment by Kaloian Manassiev [ 07/Apr/17 ]

adam.martin, I believe this showed up after your commits to cleanup library dependencies.

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