Fast-DDS-Gen icon indicating copy to clipboard operation
Fast-DDS-Gen copied to clipboard

comparing floating point types in generator equality operator

Open JSG-0 opened this issue 1 year ago • 0 comments

here is my dataArray.idl contents:

struct dataPair
	{
	float	real;
	float	img;
	};

struct dataArray
	{
	dataPair		dataPairs[64];
	};

Code generated using fastddsgen version 3.0.1 : fastddsgen -cs -ppDisable -replace dataArray.idl

Compiling on Ubuntu 20.04 with gcc-13.3.0 with the flag -Wfloat-equal catches these errors: dataArray.cxx:85:20: error: comparing floating-point with '==' or '!=' is unsafe dataArray.cxx:86:18: error: comparing floating-point with '==' or '!=' is unsafe

JSG-0 avatar Feb 15 '24 21:02 JSG-0