Probably get chewed out for cross-posting, as I mistakenly posted this in the Due forum. But, here goes...
I have two programs which communicate over serial to a PC. Although both are based on the same code, compiled with the same compiler, and both are running on the exact same hardware, when I do a "Serial.printf("hello\n");" one of them sends the string terminated by a single LF (as it should), and the other sends the string terminated by CR/LF! I can't for the life of me figure out why they are behaving differently. If I change the string to "hello\r", they both send the string followed by a CR, as they should. They are both communicating with a PC terminal program which is doing NO mapping so I can see what is actually received.
This happens whether the Serial port used in the Due Programming Port, Native Port, or one of the HardwareSerial ports, so it seems to be something happening within printf or perhaps the Stream or Print drivers.
Is there some magic setting or incantation that can cause LF to be conditionally mapped to CR/LF? There is nothing different in my code that could possibly explain this.