Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Silly gcc bugs



> 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.)

> gchecksum.c:1250: error: insn does not satisfy its constraints:

This I'm not competent to help with.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index