On 07.06.2012, at 12:43, Andris Pavenis wrote:
> On 06/07/2012 01:31 PM, Lukas Zeller wrote:
>> [...]
>> -#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m,
>> ##_args)
>> +#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m
>> "\n", ##_args)
>> [...]
>> Can you please check if this solves the problem in your build?
> If You verify my recent e-mails, you'll find exactly the same suggestion
> ("\n" added as above).
Emails to me? Or to the list? I haven't seen anything about that LF topic
before "[os-libsynthesis] [PATCH] Improve readability of SyncML TK error
messages".
> CONSOLE_PRINTF_VARARGS (and other similar macros) can however be used to
> output a message in parts (not only entire message in one piece) in that case
> extra "\n" are not needed.
The convention throughout libsynthesis is that debug macros must output an
entire message, not just a chunk of text, exactly for the reason that the
output channel can do things like prefixing.
If a message line needs to be constructed from parts, that needs to be done
outside of the macro by accumulating into a string variable, and then using the
macro to output it as a whole.
SMLERRPRINTFX() and CONSOLEPRINTF() are no exceptions to this - that's why
these should not be fed strings with trailing LF.
It's the responsibility of the output channel/macro to add an appropriate
end-of-line character. That was missing in the CONSOLE_PRINTF_VARARGS() macro.
> The same about the string "SYSYNC " which should be present only at the begin
> of the message but any more in the middle. That was a reason why I dropped
> earlier suggestion which was identical with Yours and suggested other way.
Agreed, but when following the convention that doesn't happen anyway.
Best Regards,
Lukas
_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis