K
Kevin D. Quitt
Statistics
show that 98.7 percent of all statistics are made up.
My .sig for over 20 years:
Statistics
show that 98.7 percent of all statistics are made up.
Kevin said:My .sig for over 20 years:
--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
Per the FCA, this address may not be added to any commercial mail list
Joe said:What do you suppose those commas will do?
was shocked to see the number of supporters for the author. I also find it
hard to believe that 99% of all code has memory leaks; but, I suppose I
could be wrong.
I find it hard to believe that even 90% of all C code even uses
dynamic memory allocation. I'll even let you count use of fopen()
as a memory leak if you fail to fclose() the file (since that's a
file leak and probably a memory leak since buffers are likely
allocated dynamically by the implementation). I still don't think
90% of all programs use either dynamic memory allocation OR open
files (other than the pre-opened stdin, stdout, and stderr).
Show me a way to create a memory leak in standard C without using
malloc, free, calloc, realloc, fopen, or freopen. (Leaks internal
to the standard library implementation don't count: that's the
implementation's problem.)
Gordon L. Burditt
Jirka, I don't know why. The parens have no effect. The comma in anJirka said:Why did he include all these ()? What do *you* think?
In said:Show me a way to create a memory leak in standard C without using
malloc, free, calloc, realloc, fopen, or freopen.
In said:Would this count as a memory leak:
void doStuff() {
char buf[10];
doStuff();
}
i.e. in general a buggy recursive-descent program that grabs some stack on each
invocation but fails to return every time it should.
Dan Pop said:Show me a way to create a memory leak in standard C *by* using free ;-)
Ed Morton said:Would this count as a memory leak:
void doStuff() {
char buf[10];
doStuff();
}
A guy at http://www.embedded.com gave his opinion on the C language
and I was shocked to see the number of supporters for the author.
I also find it hard to believe that 99% of all code has memory leaks;
but, I suppose I could be wrong.
See what you think:
http://www.embedded.com
Take a look at
http://www.ganssle.com/bio.htm
Evidently, Jack Ganssle makes his living by lecturing and writing
articles and books on embedded computing.
He doesn't appear to have any other credentials
in embedded computing or in C programming.
Show me a way to create a memory leak in standard C without using
malloc, free, calloc, realloc, fopen, or freopen. (Leaks internal
to the standard library implementation don't count: that's the
implementation's problem.)
Jirka, I don't know why. The parens have no effect. The comma in an
expression separates its left and right parts, the right part surviving.
Thus 20,000 == 0 and -7,000 == 0 and the if () above is true.
Why do *you* think he included the parens?
It is true that C allows you to do stupid things. It is also true that C
allows you to do clever things. C doesn't get in your way. It's up to you.
If you'd rather it were up to the language to protect you from yourself,
you're using the wrong language. C is powerful, like a chainsaw. And just
like a chainsaw, it can do a lot of damage in the wrong hands. That doesn't
mean that C is a bad language, any more than chainsaws are bad tools.
The 99% figure is wrong. Only 90% of PC programs have memory leaks. (So
prove me wrong.) Cf Sturgeon's Law.
Ok, I got it. ',' lower than '=='. Sorry for the noise.Arthur said:Try it without the parentheses, and see whether C still sucks.
Then put them back, and consult your handy precedence table.
In said:Does undefined behavior count?
Dan Pop said:Where does the standard say that undefined behaviour results in memory
leaks?
Where does the standard say that undefined behaviour results in memory
leaks?
In said:Where does it say it doesn't?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.