This is just a simple code for convert the float to char array.
If this work, will then integrate to my application code which get pitch roll yaw from IMU then publish the pitch to PC via BLE. The BLE communication code that accept char array.
You specify that the minimum width of the output should be 180 (why ?) but use a buffer of 8 characters, then compound the problem by assigning the result to a String when you almost certainly don't need to.
As a start try reducing the width parameter to 7 or less
Why a picture rather than copy the error message and post it here in code tags ? Your picture even shows the very convenient "Copy error messages" button
I suspect this has nothing to do with the code but instead is caused by a corrupted installation of the Arduino IDE (actually the avr-gcc tool bundled with the IDE). Try uninstalling and then reinstalling the Arduino IDE.