Re: How to develop a random number generation device



On Sep 19, 2:03 pm, Rich Grise <r...@xxxxxxxxxxx> wrote:
Static analysis tools can only find some bugs. Some code has to be
stepped through to see if it ever gets stuck or goes into a loop. I'm
thinking of things like:

while (X > 1) do
if (X is even) X = X/2;
else X = 3 * X + 1;

It is really hard to see whether for some values of X this sticks in a
loop or not.

It didn't take me any time at all to see that this has no bounds checking;
what happens if someone passes X=1.42857 to it?

X is an integer. Most other readers understood what I meant by the
comment.


This little example-oid was clearly written by one of those lame
programmer-wannabees who keeps sniveling "All Software Has Bugs And
There's Nothing You Can Do About It!!!" as an excuse for his
incompetence/laziness.

No, it is an example of a proof that you can't check your code by
running it through a compiler, or static checker, no matter how clever
that code may be unless you are willing to have the compiler take
weeks to compile. Problems of this sort require either a new method
be found or that all cases be explored.



Cheers!
Rich


.



Relevant Pages

  • Re: IEEE-FP 0.5.2 - Exception handling
    ... never converge and get stuck in a loop. ... IEEE arithmetic iteself, which is off-topic for this discussion. ... and how a compiler behaves. ...
    (comp.lang.forth)
  • Re: IEEE-FP 0.5.2 - Exception handling
    ... never converge and get stuck in a loop. ... Numeric input conversion is done by the ... and how a compiler behaves. ...
    (comp.lang.forth)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... >> both less efficient and less safe than the Fortran and Basic standard. ... >> The C for loop is actually trying to do what a do loop does. ... sloppy thinking that results from confusing a programming language ... > I do not believe that you are capable of writing a conforming C compiler. ...
    (comp.programming)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... it's a for loop in the C sense. ... > sloppy thinking that results from confusing a programming language ... >> I do not believe that you are capable of writing a conforming C compiler. ... Does Microsoft's C compiler perform this optimisation? ...
    (comp.programming)
  • Re: Histogram of character frequencies
    ... generated object code may simply be a loop in which elements are ... believe any C compiler anywhere would reject it. ... On the first iteration of the loop you test the end of file indicator ...
    (comp.lang.c)