From ce33e9a0b6d09fb2dd4ecb574c66b9b419cc9be7 Mon Sep 17 00:00:00 2001 From: Chris B Date: Tue, 2 Apr 2024 09:07:38 -0500 Subject: [PATCH] [0017] Update proposal with details on integers (#185) This adds the details for the C integer literal rules that this proposal intends to adopt. --- proposals/0017-conforming-literals.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proposals/0017-conforming-literals.md b/proposals/0017-conforming-literals.md index 5d42fae1..a42753a8 100644 --- a/proposals/0017-conforming-literals.md +++ b/proposals/0017-conforming-literals.md @@ -50,8 +50,12 @@ which states: This proposal adopts this behavior for floating literals. -Similarly this proposal adopts 32-bit integer as the default representation for -integer literals. +Similarly this proposal adopts C rules for non-suffixed integer literals. The +type of a base-10 non-suffixed integer literal is the first integer type from +the list [`int32_t`, `int64_t`] which can represent the specified literal value. +The type of an octal, hexadecimal or binary non-suffixed integer literal is the +first type from the list [`int32_t`, `uint32_t`, `int64_t`, `uint64_t`] that can +represent the specified literal value. ### Benefits of this solution