C file should be used by default as only Arduino and mbed require C++ files.
There might be a lot of legacy projects so custom transport is also set to use C++.
Some boards, like ESP32 based boards, give some unintelligible data when connecting to them via Serial. This is sometimes data that is send with the wrong baud rate (hard baked into the boot loader), or something else. It's hard to prevent this from happening. When a build is uploaded to the ESP board for unit testing, the decoding of the incoming stream should not fail the test due to some garbled content. Since the read data is validated on line 95, any garbage is automatically ignored and only outputted to the console.
Without this, the compiler will generate unused parameter warnings in
the native version:
test/output_export.cpp: In function ‘void output_start(unsigned int)’:
test/output_export.cpp:6:32: error: unused parameter ‘baudrate’ [-Werror=unused-parameter]
void output_start(unsigned int baudrate)
^~~~~~~~
cc1plus: all warnings being treated as errors