Skip to content
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

Enable strict enforcement of signedness constraints #42

Merged
merged 35 commits into from
May 8, 2020
Merged

Conversation

kulp
Copy link
Owner

@kulp kulp commented May 8, 2020

In the same vein as #39, we enable -Werror=sign-conversion enforcement, and standardize on signed numbers where possible, even where negative numbers are not particularly meaningful, to avoid problems with integer promotion rules and to simplify the mental model

kulp added 30 commits May 8, 2020 12:13
Integers in tenyr are 32-bit signed numbers by default. Much of the code
in this implementation of tenyr, however, has used `uint32_t` often,
where `int32_t` would be more semantically correct.

`UWord` in the object format was left alone, for now, although a case
could be made for standardizing on `SWord` there, too.
This could be considered a breaking change to object version 2, but we
are not at tenyr v1.0.0 yet, and nobody has objects that are large
enough to matter. "Thirty-one bits should be enough for anyone."

The "toolong" test case was updated to use the maximum signed 32-bit
size instead of the maximum unsigned 32-bit size.
@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #42 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop      #42   +/-   ##
========================================
  Coverage    87.39%   87.39%           
========================================
  Files           34       34           
  Lines         2817     2817           
  Branches       508      508           
========================================
  Hits          2462     2462           
  Misses         186      186           
  Partials       169      169           

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 f15bcbc...f15bcbc. Read the comment docs.

@kulp kulp marked this pull request as ready for review May 8, 2020 23:57
@kulp kulp merged commit 72ed82d into develop May 8, 2020
@kulp kulp deleted the strict-signedness branch May 9, 2020 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant