
Hello Wolfgang / Albert / others,
On 10-10-14 16:04, Jeroen Hofstee wrote:
Hello Wolfgang,
On 10-10-14 14:22, Wolfgang Denk wrote:
It does not mention puts() vs. printf(), if it is indeed meant to be u-boot policy.
This is not just U-Boot philosophy, but something that I would consider a matter of course when writing code - using the appropriate tools for the task at hand. If all you want to do is sendout a constant string to the utput device, there is no need to invoke a function that provides fancy formatting options.
Don't we always try to use the smallest, most efficient tool that is suited for a task?
calling printf("%s\n", "string") gets translated into puts by the compiler. There should be no difference in the binary.
mumbles: while this is true in general it won't hold for u-boot since -ffreestanding disables such rewrites and u-boot is compiled with that flag. On the bright side, perhaps I educated some people a bit that they are wasting time rewriting such lines in normal, hosted applications.
Regards, Jeroen