bastibl / gr-rds

FM RDS/TMC Transceiver
http://en.wikipedia.org/wiki/Radio_Data_System
GNU General Public License v3.0
219 stars 73 forks source link

Use abs(int) not abs(double) #11

Closed jwakely closed 8 years ago

jwakely commented 8 years ago

When <math.h> gets included abs is overloaded for type double and so abs(toffset*2)&0x1f attempts to do bitwise AND on a double, which is ill-formed. This causes a build failure with GCC 6, which now provides a conforming <math.h> header. The fix is to ensure abs(int) is used instead.

bastibl commented 8 years ago

thanks!

bastibl commented 8 years ago

I just pushed a follow-up. I think toffset should be an int in the first place. What do you think?

jwakely commented 8 years ago

I did wonder about that. I think you're right and making it int makes more sense.