-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More compiler warnings, and sanitizers, in CMake builds #2138
Conversation
An inline function (not method!) in a header file shouldn't be declared `static` or it'll be copied into every compilation unit that uses it.
66ad5fc
to
529d81a
Compare
and removed Channel.cc which was empty
It's timing-sensitive, and in particular has started failing now that sanitizers are enabled. All it seems to do is check that an unsorted query is faster than a sorted one.
1. The replicator's pending-documents API would leak a Checkpointer object on each call, because it was allocated with a bare `new` and not deleted in the destructor. 2. The query translator would leak a locale string when parsing a COLLATE expression, because the CollateNode class contained a Collation object, which wasn't freed by the arena allocator. 3. c4db_collectionNames and c4db_scopeNames would leak Fleece mutable arrays if the db is closed, due to an exception being thrown.
- Turned off -Wformat in Linux builds since it causes warnings everywhere we pass int64_t through a printf-type function, which is not actually a problem. - Suppressed a false "control reaches end of non-void function" in ExprNodes.cc. - Fixed a few places in BLIP where values of different enum types are or-ed together.
Code Coverage Results:
|
It would be cleaner to fix this by editing c4LocalReplicator.hh in the couchbase-lite-core-EE repo, but that would involve more work wrestling with Git repos.
With this PR, will it compile with the master branch of fleece? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok code wise but fleece needs to be merged first and then this PR updated to point to the master branch.
@borrrden the fleece reference actually points to a commit that has same content as master (via git diff ..master). I changed it to be actual master branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blackduck check is a false positive because of source edits (though at what point does it become our own forked product and not a third party one in terms of security scan...)
CBL-6148: Update Replication Protocol for 4.0 (#2140) 683737c Fixed incorrect SchemaVersion::Current (#2153) 44a0d4a Make test logs readable in CLion (#2143) d53db2e More compiler warnings, and sanitizers, in CMake builds (#2138) 23441ce CBL-6288: Disable Replication tests in Actions. (#2151) 56f7749 Fixed UB when a CollectionChangeObserver deletes itself in its callback (#2123) 6eb8ec8 Pick up latest from the master branch of fleece. (#2145) a177348 QueryTranslator: Implemented predictive index support (#2141) CBL-5616: Update SG docker version (again)
Added new CMake options:
LITECORE_WARNINGS_HARDCORE
enables all compiler warnings except for a few dozen that are too onerous, plus-Werror
.LITECORE_SANITIZE
enables the Clang Address and UB sanitizers.Currently these are only supported in Clang builds, and ignored with other compilers. They are propagated to Fleece (see couchbase/fleece#239)
Also made source changes to fix some new warnings produced by this.