Re: Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-12 Thread Thierry Moreau
Joseph S. Myers wrote: On Tue, 12 Jun 2012, Bin.Cheng wrote: I noticed that GCC now can check format string of printf functions, so I am wondering if it is possible to take advantage of this utility, by making gcc detect whether printf prints floating point number and then generate assembly dir

Re: Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-12 Thread Joseph S. Myers
On Tue, 12 Jun 2012, Bin.Cheng wrote: > >> I noticed that GCC now can check format string of printf functions, so > >> I am wondering if it is possible to take advantage of this utility, by > >> making gcc detect whether printf prints floating point number and then > >> generate assembly directive

Re: Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-11 Thread Bin.Cheng
On Tue, Jun 12, 2012 at 4:23 AM, Joseph S. Myers wrote: > On Fri, 8 Jun 2012, Bin.Cheng wrote: > >> For example, most c programs call printf to format output data, that >> means floating point code get linked even the program only want to >> output non-floating point numbers. Currently, we rely on

Re: Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-11 Thread Joseph S. Myers
On Fri, 8 Jun 2012, Bin.Cheng wrote: > For example, most c programs call printf to format output data, that > means floating point code get linked even the program only want to > output non-floating point numbers. Currently, we rely on end-user to > call iprintf if the program does not want floati

Re: Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-10 Thread Oleg Endo
On Fri, 2012-06-08 at 16:54 +0800, Bin.Cheng wrote: > Hi all, > In micro-controller applications, code size is critical and the size > problem is worse if library is linked. > For example, most c programs call printf to format output data, that > means floating point code get linked even the progra

Is it possible to make gcc detect whether printf prints floating point numbers?

2012-06-08 Thread Bin.Cheng
Hi all, In micro-controller applications, code size is critical and the size problem is worse if library is linked. For example, most c programs call printf to format output data, that means floating point code get linked even the program only want to output non-floating point numbers. Currently, w