This code doesn't compile in XE :
const
InitSignature : array[0..3] of LongWord =
($67452301, $EFCDAB89, $98BADCFE, $10325476);
[DCC Error]: E2026 Constant expression expected
but this DOES:
const
InitSignature : array[0..3] of Cardinal =
($67452301, $EFCDAB89, $98BADCFE, $10325476);
Assignable typed constants is ON.
If I cast all the array values to LongWord in the first sample the code compiles. But I cannot get what's the difference between LongWord and Cardinal?
I'm going to be bold, and state *there is no difference*. You arrived at the wrong conclusion somehow, and provided us with not enough information to help you out. I'm convinced you didn't paste a 1:1 copy of your code here, and you left out something relevant.
Could be an evil workmate who pasted a little inivisble unicode character before the opening parenthesis, and defined that same character as a function elsewhere. It could also be something a little more obvious.
Can you reproduce the issue in a clean project? Because I'm pretty sure you can't. If you can, post back. If you can't, post more context. By all means, prove me wrong.