Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Toolchain related fixes #1192

Merged
merged 7 commits into from
Sep 20, 2020
Merged

Conversation

gonzalezjo
Copy link
Collaborator

This collection of fixes allows us to build using clang-10 and gcc-10.

Note that this does not allow us to build using llvm-10's libraries. This is purely addressing the new warnings. In the process, though, it does make some functional changes:

  1. RowsAffected and NumRows now return a uint32_t. Technically speaking, this limits the number of rows we can return to ~4 billion. Practically speaking, we were always limited to ~4 billion because the network protocol is uses uint32_ts to tell the client how many rows it's returning.

This just propagates the fundamental network limits through the type system.

(While I'm pretty sure a whole lot of other things will break before TrafficCop if we ever try to return 4 billion rows, this change had to be made in order for us to build under gcc-10)

  1. The cast-safety functions in binder_util and cast_operators have been adjusted to deal with a bizarre edge-case that clang-10 now checks for. It boils down to floats and doubles quantizing in an unfortunate and counter-intuitive manner. Example here: https://godbolt.org/z/M14jdb

These two functional changes are in need of review.

gcc-10 doesn't like how we didn't include cstdint in one file; in other cases, it didn't like the implicit cast to an unsigned. In another case, it didn't like that we return a uint64_t as an element of a uint32_t.

In the last case, we now limit the amount of rows we can affect or return to 2^32. This is technically a functional change, but before, returning 4 billion rows would've caused issues at the network layer, so it isn't a *real* functional change.
Recasts to a void* before using memset in order to appease -Wclass-memaccess.
See b962fbb15c9f1fb2f5410ff0cf3a4065088c717e
See c61a9071ae9410daa629246c46a24165626f992b
Would like someone to review this to make sure I didn't hallucinate anything. Fixes clang-10 warnings.
@gonzalezjo gonzalezjo added the ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. label Sep 18, 2020
@codecov
Copy link

codecov bot commented Sep 19, 2020

Codecov Report

Merging #1192 into master will decrease coverage by 1.06%.
The diff coverage is 77.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1192      +/-   ##
==========================================
- Coverage   82.77%   81.70%   -1.07%     
==========================================
  Files         651      650       -1     
  Lines       46983    43674    -3309     
==========================================
- Hits        38888    35683    -3205     
+ Misses       8095     7991     -104     
Impacted Files Coverage Δ
src/include/storage/access_observer.h 100.00% <ø> (ø)
src/binder/binder_util.cpp 57.93% <33.33%> (-0.94%) ⬇️
src/traffic_cop/traffic_cop.cpp 74.19% <75.00%> (ø)
src/catalog/database_catalog.cpp 95.84% <100.00%> (ø)
src/include/common/container/concurrent_bitmap.h 98.33% <100.00%> (-1.67%) ⬇️
src/include/execution/exec/execution_context.h 88.46% <100.00%> (ø)
src/include/execution/exec/output.h 100.00% <100.00%> (ø)
...c/include/execution/sql/operators/cast_operators.h 35.71% <100.00%> (+1.16%) ⬆️
src/optimizer/input_column_deriver.cpp 56.84% <0.00%> (-12.46%) ⬇️
...cution/compiler/expression/constant_translator.cpp 62.22% <0.00%> (-9.52%) ⬇️
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fca44d...b641e74. Read the comment docs.

@mbutrovich
Copy link
Contributor

LGTM

@mbutrovich mbutrovich added best-practice Style fixes or refactor in the code base. Mark issues with this. ready-to-merge This PR is ready to be merged. Mark PRs with this. and removed ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. labels Sep 20, 2020
@mbutrovich mbutrovich merged commit e7a93c1 into cmu-db:master Sep 20, 2020
thepinetree pushed a commit to thepinetree/noisepage that referenced this pull request Oct 13, 2020
* Fix gcc-10 uint32_t related issues

gcc-10 doesn't like how we didn't include cstdint in one file; in other cases, it didn't like the implicit cast to an unsigned. In another case, it didn't like that we return a uint64_t as an element of a uint32_t.

In the last case, we now limit the amount of rows we can affect or return to 2^32. This is technically a functional change, but before, returning 4 billion rows would've caused issues at the network layer, so it isn't a *real* functional change.

* Fix gcc-10 -Wclass-memaccess issue

Recasts to a void* before using memset in order to appease -Wclass-memaccess.

* spdlog bugfix

See b962fbb15c9f1fb2f5410ff0cf3a4065088c717e

* json library bugfix

See c61a9071ae9410daa629246c46a24165626f992b

* Use references instead of copies

clang-10 bugfix

* Obscure numeric representability bugfix

Would like someone to review this to make sure I didn't hallucinate anything. Fixes clang-10 warnings.

* clang-format fixes

oop
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
best-practice Style fixes or refactor in the code base. Mark issues with this. ready-to-merge This PR is ready to be merged. Mark PRs with this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants