Most compilers should promote the constant initializer (expression). Of bigger issue is the inconsistancy of integer of specific width i.e. what is int vs long or
__int32, _int32_t, int32_t, etc...
For constant expressions consider a cast of constructor (if C++)
T foo = (T)123;
T foo = T(123);
>>...Of bigger issue is the inconsistancy of integer of specific width i.e. what is int vs long...
This is a good example and I saw this so many times on different projects. Every time I was asking a question: "Why do you need to declare a variable as 'long'? Could you be more specific and declare the variable as some 'int'?"
>>...Could that be because those suffixes are reserved for constant integer types declaration and can not be used in the macro
Yes and this is what I was able to see today. It gets even worse for L because in a UNICODE environment it is used as a Character Constant:
wchar_t wcText = L'abc';
>>>Yes and this is what I was able to see today. It gets even worse for L because in a UNICODE environment it is used as a Character Constant:>>>
It does not surprise me.Those letters in variuos programming "contexts" have various meaning.Probably at the parser stage those keywords are interpreted as UNICODE charcters and later from the whole sentence context the proper meaning is deducted.
I think that in your first case those suffixes are treated as a reserved keywords and checked for it already at the preprocessor stage.
the answer to your initial problem is that parts of identifiers cannot be substituted by macros.
In your example 4_ULL is treated as a single identifier at the preprocessing stage (even though it doesn't make sense semantically). Please note that "_" (underscore) is a valid part of an identifier and not a delimiter.
int, long, ..._L, ..._UL... all should be avoided when specific numerical size is required. This is not to say these should never be used, rather it is to say do not rely on a particular number of bits, or minimum number of bits. Unfortunately for us programmers, there is no standardized naming convention amongst all compiler vendors.