[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[QUESTION] Usage of '0b' as a prefix for numerical constants?
From: |
Aleksandar Markovic |
Subject: |
[QUESTION] Usage of '0b' as a prefix for numerical constants? |
Date: |
Fri, 22 Nov 2019 15:56:00 +0100 |
Hello, all.
I am currently reviewing some code, and I see it uses '0b' as a prefix
of numerical constants, similar to these examples:
switch (((inst >> 22) & 0b1111111000) | ((inst >> 12) & 0b0000000111)) {
or
ARRAY_FIELD_DP32(s->regs, CRB_INTF_ID, RID, 0b0000);
I remember a while ago, something stopped me from using '0b' as a
prefix in my own code (was it checkpatch.pl, or perhaps some statement
on coding style, or a compiler, or something else - I don't really
remember), so I didn't use it, and used '0x' (hexadecimal constant).
What is really the view of the community on usage of '0b'?
Please C language standard and compiler experts, and also regular
participants like me, speak up.
Sincerely,
Aleksandar
- [QUESTION] Usage of '0b' as a prefix for numerical constants?,
Aleksandar Markovic <=