Someone should write a tool that scrapes these results and automatically files bugs at the associated bug trackers for open-source projects.
I've been thinking of doing something and i'm looking for people to work with! Notes here: http://memeschemes.com/code_search/
A common bug in published code
51–60 of 79 posts
Re: A common bug in published code
#52Last year I found several instances of the printf format "200%d" when dealing with years. Some still exist: http://hewgill.com/journal/entries/548-y2010-bugs-found-via-...
Re: A common bug in published code
#53Re: A common bug in published code
#54Earlier quoted context omitted.
I've been thinking of doing something and i'm looking for people to work with! Notes here: http://memeschemes.com/code_search/
A bug in that program would certainly be wonderful. Have fun when it files a few million unnecessary bug reports while you're sleeping.
Re: A common bug in published code
#55Re: A common bug in published code
#56A-mazing Also, notice the difference in number of results between C and C++ below: http://www.google.com/codesearch?hl=en&lr=&q=if%5Cs*... vs http://www.google.com/codesearch?hl=en&lr=&q=if%5Cs*...
That's why I write comparisons like if (CONSTANT == variable)
Re: A common bug in published code
#57One would hope at some point a tool would warn you about this since clearly it could optimize (int) Math.random() to just 0. [queue debate about tools that hold your hands vs understanding what you are actually writing] I wonder if they did the search for if (x = y) bug pre-gcc-4.x-warn what sort of numbers they would get.
http://findbugs.sourceforge.net/bugDescriptions.html#RV_01_T...
Re: A common bug in published code
#58Someone should write a tool that scrapes these results and automatically files bugs at the associated bug trackers for open-source projects.
I've been thinking of doing something and i'm looking for people to work with! Notes here: http://memeschemes.com/code_search/
Re: A common bug in published code
#59the main cause here is that randomness is hard to test so that code was just assumed to be correct. With randomness you can never be sure, http://www.random.org/analysis/
Yes, but... (int)Math.random() always returns zero. A little suspicious.
Re: A common bug in published code
#60Apparently, python only has 5 instances of the corresponding error: http://www.google.com/codesearch?hl=en&lr=&q=\s%2Bin... Python-Java flame-war, anyone?
ducks
All joking aside, I'm just pointing out the absurdity of comparing one language to another based on how easy it is to shoot oneself in the foot.