Gcc will generate an error here on 64 bit platforms. One solution is to use long instead of int. However the better solution is probably to templatise btDbvtNode so that the data variable is the right type in the first place. This could also be used to avoid the union. This may result in some small memory savings and the code would generally be more elegant.