gchecksum.c:1122: warning: integer constant is too large for 'long' type
gchecksum.c:1123: warning: integer constant is too large for 'long' type
sha512_sum_init is of type Sha512sum, which is guint64, which is
supposedly guaranteed to be 64 bits. However, the compiler doesn't
agree. Changing:
sha512->H[0] = 0x6a09e667f3bcc908;
to
sha512->H[0] = 0x6a09e667f3bcc908ULL;
makes it work. gcc bug?
No. This has nothing to do with the type of the LHS of the assignment.
The issue is that the number on the RHS is an integer constant, which
is defined by C to have type int or long (or perhaps the unsigned
variants thereof), depending on the size of its value - but the number
specified is too large for even long, so it's a choice between
truncating bits away or violating the language spec and giving it a
type even larger than long. (Converting it to guint64 for the
assignment happens later and is not relevant to the warning.)