[CXX-788] Number of 'const' qualifiers in return values Created: 25/Dec/15  Updated: 11/Jan/16  Resolved: 04/Jan/16

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: 0.2.0
Fix Version/s: 3.0.0-rc0

Type: Bug Priority: Trivial - P5
Reporter: rayslava Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: C++11 Driver MongoDB 3.2

 Description   

In current master branch (currently checking cdf412bb6ea4692add71e00d39db60a9d5a61f97 commit) there is a number of const qualifiers on API functions which produces compilation warnings/errors

/usr/include/mongocxx/v0.3/mongocxx/options/index.hpp:48:34: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
        MONGOCXX_PRIVATE virtual const int type() const = 0;
                                 ^~~~~~
/usr/include/mongocxx/v0.3/mongocxx/options/index.hpp:75:26: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
        MONGOCXX_PRIVATE const int type() const override;
                         ^~~~~~

I think the check for ignored qualifiers should be added to CI also since current version breaks application build with -Wall -Wextra -Werror flags.



 Comments   
Comment by Githook User [ 04/Jan/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-788 Fix some -Wall and -Wextra warnings under clang and gcc
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/4c378624e6fc7e0db3b99f3c0cef9e517cdf2533

Comment by Andrew Morrow (Inactive) [ 27/Dec/15 ]

https://github.com/mongodb/mongo-cxx-driver/pull/406

Comment by Andrew Morrow (Inactive) [ 25/Dec/15 ]

Thanks for the bug report. I agree this should be fixed, so I've scheduled this ticket for the upcoming rc0 release. You are also welcome to send us a pull request.

We do already have a ticket for turning on -Wall and -Werror on the CI system, see CXX-777.

Generated at Wed Feb 07 22:00:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.