Re: printf() leak?

2011-03-29 Thread David Demelier
On 29/03/2011 09:59, Eitan Adler wrote: Hi David, It seems printf() always alloc something and does not free it: What compiler and what optimizations? Most compilers will optimize a printf without any special formatting into a puts call instead of a printf call. I was using clang / gcc with

Re: printf() leak?

2011-03-29 Thread Eitan Adler
Hi David, > It seems printf() always alloc something and does not free it: What compiler and what optimizations? Most compilers will optimize a printf without any special formatting into a puts call instead of a printf call. For example clang -O3 -fomit-frame-pointer (which I use for clarity here

Re: printf and utf-8

2009-01-28 Thread Frank Shute
On Tue, Jan 27, 2009 at 12:05:28AM +0100, Svein Halvor Halvorsen wrote: > > Chuck Swiger wrote: > >On Jan 26, 2009, at 1:58 PM, Svein Halvor Halvorsen wrote: > >>As far as I can see, printf is not calculating strings lengths > >>correctly when using utf-8 encoding. Either that, or I'm using byte

Re: printf and utf-8

2009-01-27 Thread Mel
On Monday 26 January 2009 12:58:06 Svein Halvor Halvorsen wrote: > As far as I can see, printf is not calculating strings lengths correctly > when using utf-8 encoding. Either that, or I'm using byte count, and > can't find the character count :-/ > > Eg: > > $ printf "|%-10s|" "æøå" > > |æøå|

Re: printf and utf-8

2009-01-27 Thread Thomas Dickey
On Mon, Jan 26, 2009 at 03:03:44PM -0800, Chuck Swiger wrote: > On Jan 26, 2009, at 3:05 PM, Svein Halvor Halvorsen wrote: > >Do you have a suggestion to solve the following problem without > >using printf(1): > > > >I have a text file that I want to print in a "box" on a terminal > >from a she

Re: printf and utf-8

2009-01-26 Thread Svein Halvor Halvorsen
Chuck Swiger wrote: On Jan 26, 2009, at 3:05 PM, Svein Halvor Halvorsen wrote: Do you have a suggestion to solve the following problem without using printf(1): I have a text file that I want to print in a "box" on a terminal from a shell script. Now I've padded the lines with spaces to a cert

Re: printf and utf-8

2009-01-26 Thread Chuck Swiger
On Jan 26, 2009, at 3:05 PM, Svein Halvor Halvorsen wrote: Do you have a suggestion to solve the following problem without using printf(1): I have a text file that I want to print in a "box" on a terminal from a shell script. Now I've padded the lines with spaces to a certain length using

Re: printf and utf-8

2009-01-26 Thread Svein Halvor Halvorsen
Chuck Swiger wrote: On Jan 26, 2009, at 1:58 PM, Svein Halvor Halvorsen wrote: As far as I can see, printf is not calculating strings lengths correctly when using utf-8 encoding. Either that, or I'm using byte count, and can't find the character count :-/ printf(1) explicitly states that it w

Re: printf and utf-8

2009-01-26 Thread Chuck Swiger
On Jan 26, 2009, at 1:58 PM, Svein Halvor Halvorsen wrote: As far as I can see, printf is not calculating strings lengths correctly when using utf-8 encoding. Either that, or I'm using byte count, and can't find the character count :-/ printf(1) explicitly states that it works with ASCII and

Re: "printf" doesn't work in ia64_init()?

2004-07-27 Thread Marcel Moolenaar
On Tue, Jul 27, 2004 at 08:38:00AM +, M.M. Yang wrote: > Hi all, > I'm reading the function ia64_init(), and try > to use "printf" to output some information. But if I put "printf" before > "msgbufinit()", I won't see any word I expect by using dmesg. That's correct. > In the same funct

Re: printf...! BSD

2003-02-10 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Auge Mike <[EMAIL PROTECTED]> typed: > > Now what resources you can recommend for me! I prefer Internet resources. You can find at http://www.freebsd.org/docs.html >. Of course, you could have found that yourself by looking at the Freebsd.org front page.

Re: printf...! BSD

2003-02-10 Thread northern snowfall
Just try reading the FreeBSD kernel source. All the answers are right there. Why read a book or an article about how it works when you can see how it works for yourself =) Don To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message

Re: printf ... !

2003-02-08 Thread northern snowfall
This is the definition of the write(2) system call. You should also check the implementation of printf(3) at the libc sources. Look at /usr/src/lib/libc/stdio/printf.c for more details about the way printf() works in userlevel programs. Right on. I think, however, that Auge is looking for a t

Re: printf ... !

2003-02-08 Thread Giorgos Keramidas
On 2003-02-08 01:48, Auge Mike <[EMAIL PROTECTED]> wrote: > I was trying to know how "printf" works in FreeBSD... I hvae reached > to this point : > > #define _write(fd, s, n) \ > __syscall(SYS_write, (int)(fd), (const void *)(s), (size_t)(n)) This is the definition of the write(2) system ca

Re: printf prints WRONG double precision values

2003-01-16 Thread Gary W. Swearingen
Ugen <[EMAIL PROTECTED]> writes: > double pi = 3.14159265358979323846 ; > printf("%20.19f\n", pi); > and here is what you get: > host: [16:45] [127] /tmp>./test > 3.1415926535897931160 Function "printf" is only working with the 64 bits of info in variable "pi" not the more-than-64 bits o

Re: printf prints WRONG double precision values

2003-01-16 Thread Kent Stewart
On Thursday 16 January 2003 01:47 pm, Ugen wrote: > Try this: > > #include > int main() > { > double pi = 3.14159265358979323846 ; > > printf("%20.19f\n", pi); > } > > and here is what you get: > host: [16:45] [127] /tmp>./test > 3.1415926535897931160 > > The error in last 4 or digits i