You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When defining a macro to an arithmetic constant value using the #define preprocessor directive, the norminette outputs an error saying it is not constant. A similar issue had already been opened before (#357), but the problem seems to not have been fixed. Also, the solution to directly put the resulting value isn't by making the code as readable as possible, as sometimes precise how we get this result is important to not making it a magic number. For example, if the documentation says the bit at position 31 of a specific bitfield corresponds to a specific flag F, then it's much more readable and consistent to define it as 1<<31 than 0x80000000, 0b10000000000000000000000000000000, or even worse, 2147483648.
Erroneous code
#defineI_AM_A_CONSTANT 1<<31
Additional infos
norminette 3.3.55
The text was updated successfully, but these errors were encountered:
Describe the bug
When defining a macro to an arithmetic constant value using the
#define
preprocessor directive, thenorminette
outputs an error saying it is not constant. A similar issue had already been opened before (#357), but the problem seems to not have been fixed. Also, the solution to directly put the resulting value isn't by making the code as readable as possible, as sometimes precise how we get this result is important to not making it a magic number. For example, if the documentation says the bit at position 31 of a specific bitfield corresponds to a specific flagF
, then it's much more readable and consistent to define it as1<<31
than0x80000000
,0b10000000000000000000000000000000
, or even worse,2147483648
.Erroneous code
Additional infos
norminette 3.3.55
The text was updated successfully, but these errors were encountered: