migration from w2k to win7 broke newlines

OP (Company: Voom Technologies, Inc.) #3087928
Our product uses an Atmel AT91R40008 processor.
The w2k environment is:
* Cygwin 1.3
* eCos 1.3.1
* gcc toolchain arm-elf 2.95

The win7 environment is:
* Cygwin 1.7
* eCos 1.3.1
* gcc toolchain arm-elf 4.6.0

Something in the win7 environment broke some, but not all of the 
trailing newline characters we output via RS-232.  I've looked at the 
printf calls.  There's no practical difference between the calls that 
get truncated and the calls that work.
For instance,
1
start.h:
2
#define START_MSG "\nStart\n"
3

4
start.cpp:
5
printf("%s", START_MSG);
6
-or-
7
printf("\nStart\n");
both fail to print the trailing newline, while
1
format.h:
2
#define SPINNING_MSG "Spinning Drive"
3

4
main.cpp:
5
printf("%s %s\n", SPINNING_MSG, drive_text);
will print the trailing newline.

I've tried the -ansi flag to no avail.

Any suggestions to try and track this ?bug/feature? down?
The same code in the w2k environment works fine.
Thanks in advance.
Moderator #3088065
Your failing printf()s are probably replaced by the compiler by
puts(), where the compiler omits the trailing newline since puts()
is supposed to add it by itself.  If the puts() implementation is
broken (for whatever reason), then the trailing newline is missing
in the output.

Reply

A question of your own? This thread is over 13 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.