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

Let the compiler determine char signedness #454

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

roehling
Copy link
Contributor

@roehling roehling commented Feb 7, 2025

Instead of special-casing or assuming a particular signedness, you can
use the boolean expression ((T)(-1) < 0) to determine signedness of an
integer type at compile time.

Copy link

codecov bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.96%. Comparing base (54fa780) to head (630bff2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #454   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files          33       33           
  Lines        2703     2703           
=======================================
  Hits         2621     2621           
  Misses         82       82           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@stotko stotko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM in general subject to some minor points. Could you have a look at these?

Instead of special-casing or assuming a particular signedness, you can
use the boolean expression ((T)(-1) < 0) to determine signedness of an
integer type at compile time.
Copy link
Owner

@stotko stotko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging.

@stotko stotko merged commit b51c470 into stotko:master Feb 10, 2025
61 checks passed
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.

2 participants