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

[libc] Fix size_t used without including stddef.h in CPP/limit.h. #78861

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Jan 20, 2024

No description provided.

@lntue lntue requested a review from jhuber6 January 20, 2024 21:09
@llvmbot llvmbot added the libc label Jan 20, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 20, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/78861.diff

1 Files Affected:

  • (modified) libc/src/__support/CPP/limits.h (+1-1)
diff --git a/libc/src/__support/CPP/limits.h b/libc/src/__support/CPP/limits.h
index e92ad00f80e037..d9e7090a0b7b19 100644
--- a/libc/src/__support/CPP/limits.h
+++ b/libc/src/__support/CPP/limits.h
@@ -20,7 +20,7 @@ namespace cpp {
 
 // Some older gcc distributions don't define these for 32 bit targets.
 #ifndef LLONG_MAX
-constexpr size_t LLONG_BIT_WIDTH = sizeof(long long) * 8;
+constexpr unsigned int LLONG_BIT_WIDTH = sizeof(long long) * 8;
 constexpr long long LLONG_MAX = ~0LL ^ (1LL << (LLONG_BIT_WIDTH - 1));
 constexpr long long LLONG_MIN = 1LL << (LLONG_BIT_WIDTH - 1);
 constexpr unsigned long long ULLONG_MAX = ~0ULL;

@jhuber6
Copy link
Contributor

jhuber6 commented Jan 20, 2024

Yeah, no point worrying about capacity here for a compile time constant.

@lntue lntue merged commit 1cc7cd4 into llvm:main Jan 20, 2024
5 checks passed
@lntue lntue deleted the limit branch January 20, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants