Hi, I want to redirect printf output to a serial port. A method for this is described here:Libraries and Floating Point Support Guide: Redefining low-level library functions to enable direct use of high-level library functions in the C library (keil.com)
However, the code described there fails to compile with Arm compiler 6.16 (it compiles fine with GCC):
#include <stdio.h> struct __FILE { int handle; }; /* FILE is typedef’d in stdio.h. */ FILE __stdout;
The error is:
error: redefinition of '__FILE' struct __FILE ^ C:\Program Files\Arm\Development Studio 2021.1\sw\ARMCompiler6.16\bin\..\include\stdio.h:119:8: note: previous definition is here struct __FILE { ^ 1 error generated.
How can I fix this please?
https://community.arm.com/support-forums/f/compilers-and-libraries-forum/47991/how-to-migrate-retarget-c-from-arm-compiler-5-to-arm-compiler-6