code below
does violate them (by casting an uint64 array to an uint32 array),
although GCC does not think so.
gcc 2.95 generates correct code.
gcc 3.2.3 fails
gcc 3.3.5 fails
gcc 3.4.2 fails
/Anders Torger
*/
#include
unsigned long
hash(void *key)
{
unsigned long long u[1
dered
errors)? I think the current behaviour is a bit dangerous, since the
code works in previous versions of GCC, and with other compilers, and
that the current compiler does accept the code although it knows that
it will probably do wrong.
/Anders Torger
On Tuesday 09 November 2004 17.26, An
Compiler makes same mistake, the only difference is the warning at
compile time, which can be avoided with this casting trick:
return ((unsigned long *)(void *)&ull)[0] ^
((unsigned long *)(void *)&ull)[1];
/Anders
On Tuesday 09 November 2004 16.56, you wrote:
> Anders Tor
from package system
from unstable as of 9 Nov 2004.
gcc -O2 -S test.c
no messages are generated at compilation.
gcc 2.95 generates correct code.
gcc 3.2.3 fails
gcc 3.3.5 fails
gcc 3.4.2 fails
/Anders Torger
*/
#include
unsigned long
hash(void *key)
{
unsigned long long