Skip to content
Commit 0079ab1c authored by Patryk Duda's avatar Patryk Duda Committed by Carles Cufí
Browse files

toolchain/llvm: Fix integer macros implementation



Currently __INT64_C() doesn't add any suffix to provided constant which
causes the constant to have 'int' type. On the other side, __UINT64_C()
adds ULL suffix which makes the constant 'unsigned long long'.

Of course, __INT64_C() is wrong here because 'int' type, in most cases,
has 32 bit width.

According to the C standard, these macros are for minimum-width integer
constants. For example, it means that using INT16_C() macro will give
you constant with type the same as 'int_least16_t' type.

Clang doesn't provide defines like __INT_LEAST16_C_SUFFIX__, which makes
implementation difficult, because we need to determine appropriate type
first.

Signed-off-by: default avatarPatryk Duda <patrykd@google.com>
parent 1f4e911d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment