Hi Tim, > Not sure if the compiler is correct here, but maybe worth a look: > > hash.c:549:11: error: implicit conversion from 'unsigned long' to > 'float' changes value from 18446744073709551615 to 18446744073709551616 > [-Werror,-Wimplicit-int-float-conversion] > if (SIZE_MAX <= new_candidate) > ^~~~~~~~ ~~ > /usr/include/stdint.h:227:22: note: expanded from macro 'SIZE_MAX' > # define SIZE_MAX (18446744073709551615UL) > ^~~~~~~~~~~~~~~~~~~~~~
This warning is pointless, because - Since the next float below 18446744073709551616 = 0x10000000000000000 would be 18446742974197923840 = 0xFFFFFF0000000000 the comparison result is the same for the two values ...615 and ...616. - The compiler inserts the implicit conversion only because of the '<=' operator. IMO you should file a ticket with the clang people. Inserting a cast to 'double' if ((double) SIZE_MAX <= (double) new_candidate) would not help, because the next double-float below 18446744073709551616 = 0x10000000000000000 would be 18446744073709549568 = 0xFFFFFFFFFFFFF800 Bruno