How to be sure of no floats

Doing a cut-down version of the CGPS “QueryApp” sample, I want to be sure that I’ve removed all floating point - how can I confirm that?

Search for float and double keywords. And also for specific printf formatter.

Is that completely sufficient?

What if there were some literal floating point constants - like 2.0 or 0.5 - hidden away somewhere?
Would that cause FP to be used, even if the final result was stored to an integral value?

It depends how you use them.

I’m pretty sure that

int x = 2.0;

would be optimised to

int x = 2;

However, anything of the form

int x = 10;
int y = x / 2.0;

will be calculated with floating point operations, and the result will be cast to an integer. Therefore you cannot rely on a simple source file search for float/double.

You would also have to consider what any libraries are doing. Can you be sure they don’t include floating point calculations?

Yes, that’s the kind of thing I was concerned about!

Presumably, a search of the Map file should reveal if any FP functions have been included - if I knew what to look for…

I’m using GCC and M2MStudio 1.1.1 - what would be the key symbols to look for…?

Presumably this would also show up in a search of the Map file…?