| PLEX86 | ||
|
Ridiculous warnings make ridiculous code. 14051
In comp.os.linux.advocacy, Kelsey Bjarnason wrote on Sun, 03 Apr 2005 03:13:08 GMT I'd not want to rely on it anyway, but gcc in particular does pick it up, if one specifies the correct options. We programmers aren't perfect, as you well know. :-) I'm not sure if it makes that much difference at the raw I-O level. The main issue is that printf() calls doprint() internally, or some such, pbutting it a scratch buffer (IINM the traditional length is 200 bytes, but I could be wrong here; I'd frankly have to look at the C library code). The scratch buffer is then fed to something -- probably fputs(), but it could be a number of things -- which then shoves it into the FILE's structure buffer. Since we're talking a few hundred bytes at most at the GHz level, this "double copy" pales in comparison to the about 5 ms write time it takes to shove it out to disk -- might be faster to write to standard output, if stdout is hooked intodev-null or the slave side of a pty (xterm-gnome-terminal-kterm-aterm-etc.), though I can't say I've done any benchmarking thereon beyond establishing that Windows' idea of a text console is absolutely horrid from a performance standpoint. Of course, most of this is caused by historic crap, such as the notion of promoting a char to an int in variadics (and in old-style 'int foo(x,y) int x; int y; { ... }' declarations, which, like Cobol, die off very slowly :-) ). I'm not sure which I like best; all of them have pros and cons: 1 printf("%d,%d-n", x,y); 3 System.out.print(x); System.out.print(","); System.out.println(y); Regex Pattern Matching algorithm in monoc JeffRelf I'm looking at the source code for mono's Regex implementation right now. You can download that source here ( use the clbutt libraries download ). One of... and then there's fwrite(&x,1,sizeof(x), stdout); fwrite(",",1,1, stdout); fwrite(&y,1,sizeof(y), stdout); fwrite("-n",1,1, stdout); which no one would seriously want to use as it writes x and y out in binary, as opposed to ASCII. :-) (I suppose one could press fcvt() into service, but that gets a bit silly as x and y are integers.) -- It's still legal to go .sigless.
|
||||||||