It used to be an old trick to access the representation of a float. That means that it is not a cast and (if not caught by UB) will give a different result except for 0 in common implementation.
At least since C99 and C++11 (unsure for previous versions), doing that invokes Undefined Behaviour because it violates the strict aliasing rule. That rule was invented to help compiler in their optimization by stating that a variable could only be accessed through its own type or through a character type. That way when the compiler has stored a float in a register, it can assume that this float will not be changed by any integer change (very simplified explaination).
But as it used to be intensively used in older programs, most compilers (even recent ones) have an option to ignore the strict aliasing rule.
Here your compiler simply warns you that this code violates the strict aliasing rule and may cause UB on some implementations.
TL/DR: using a casted pointer to access a different type is an attempt to reinterprete the underlying representation and is UB on both C and C++. It is definitely not the same as a cast.