What will they think of next...

If you believe that the newline _always_ triggers an implicit fflush()
I'm perfectly happy to join your club. But that's kinda hidden symantics.
My memory is rather faulty but I'm reasonably sure that didn't happen on
the VAX under BSD in 1983...I remember staying up all night waiting for
my first debug message to poot out because I didn't flush it.

Probably the more interesting issues are how to make the TOS debug printf()
as transparent as possible, and how to swap it out when it's no longer needed.
Someone mentioned that it would be nice to not have to wire it (I think it
would be nice to not have to wire...well...anything...but that's just me).
But maybe we could have a null implementation to use to wire-it-out?

MS

Philip Levis wrote:
On Sep 21, 2007, at 5:56 PM, Michael Schippling wrote:

Does 'regular' printf() guarantee that now?
I remember having to do fflush() if I really wanted to see something.

C stdlib printf(3) does not always block. But it can block, and you can make it block on flushing the buffer.[1] This might seem like a little nit, but it can bite you. E.g.:

call Foo.x();
printf("Got past Foo.x()\n");
call Foo.y();
printf("Got past Foo.y()\n");

Phil

[1] http://books.google.com/books?id=iRa-3L4jLhEC&pg=PA84&lpg=PA84&dq=printf+flush+newline+buffer&source=web&ots=dWntcq9i9J&sig=_r66dlfabrAEkJ8ltMzuRLysKj4

--
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to