More fixes for compiling with -ftrapv under gcc