![]() |
2010-11-04
, 20:43
|
Posts: 93 |
Thanked: 30 times |
Joined on Oct 2007
@ Glendale, CA
|
#12
|
![]() |
2010-11-04
, 21:17
|
|
Posts: 361 |
Thanked: 219 times |
Joined on Sep 2010
|
#13
|
I do marginalize the effectiveness of a static analysis code tool for detecting such issues.
Code:struct some_interface *c = get_from_global_variable(); some_callback_type f = default_callback(); if (c->do_something(c, &f)) { f(); }
What's a static code analysis tool doing to do here? It may
a ) Either detect a "potential NULL dereference", thus indicating that the 5000000 potential bugs found count is pure crap.
Now, of course their tools ain't cheap. They're doing a great service to the community IMHO but also getting some free marketing for a tool a decade or two ago would be laughed at.
Note: not saying it is useless; it's as useless as getting a human to do it: they might get it wrong, but "the more eyes...".
![]() |
2010-11-04
, 21:46
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#14
|
FWIW, Coverity does a very good job on showing only real invalid pointer defects (or real defects of any type for that matter). If you have experience w/ the tool, I am surprised that you would still have that opinion.
I would ask why there is no
check for c and f at first.
;-)
Plain defensive programming.
You know that sometimes when you look at your code over and over again you simply miss certain points.
Especially after long nights, much coffee and pizza.
If it weren't, it would go boom if the phone got stuck in an infinite loop: high drain, software dead, overheat > boom. The battery cuts power by itself if it's worth any of that 1000% markup Nokia puts on it.
The scenario you proposed would be indeed valid if Nokia used an enthusiast/modeling battery - those are only limited in amps - sometimes not even that. IIRC, they don't even make them in the same form factor.
N900 dead and Nokia no longer replaces them. Thanks for all the fish.
Keep the forums clean: use "Thanks" button instead of the thank you post.