[SERVER-1274] Client facing headers should compile cleanly with gcc's -Wall -Werror flags set Created: 21/Jun/10  Updated: 12/Jul/16  Resolved: 28/Jul/10

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 1.5.3
Fix Version/s: 1.5.7

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All GCC based systems


Participants:

 Description   

Currently (http://github.com/mongodb/mongo/commit/462feb5a9fc4388121347e2557c9f30cefe2c222), bson/bsoninlines.h fails to compile if the client codebase builds things with -Wall -Werror:

One specific example:

mongo.temp.install/include/mongo/bson/../bson/bsoninlines.h: In member function 'void mongo::BSONElement::validate() const':
mongo.temp.install/include/mongo/bson/../bson/bsoninlines.h:276: warning: comparison between signed and unsigned integer expressions

Compiling all files with -Wall -Werror is a very common practice in GCC based projects, and codebases where this is required and done automatically as part of the build will not be able to use the mongo headers unless they build cleanly in this mode. FWIW, you should probably turn on whatever Visual Studio's most draconian warning level is, and make warnings errors there as well.



 Comments   
Comment by Andrew Morrow (Inactive) [ 28/Jul/10 ]

I think the particular warning above was an artifact of SERVER-1498, where the definitions of strnlen'seen when building mongo itself differed from the definition of strneln seen when building against the mongo BSON headers. As far as I can tell, mongo currently does build correctly with gcc's -Wall, though -Werror should probably be turned on as well to keep it that way.

Generated at Thu Feb 08 02:56:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.