Re: storing an integer in a double precision



On May 7, 3:21 am, Ron Shepard <ron-shep...@xxxxxxxxxxxxxxxxxx> wrote:
In article <1k0vbos.tt28xw1d2sa2oN%nos...@xxxxxxxxxxxxx>,
 nos...@xxxxxxxxxxxxx (Richard Maine) wrote:

You also seem to have elided my comment that

Also note that the value of i after the DO loop terminates should be
huge(i)+1, which puts you in "anything can happen" territory.

I think that is very pertinent, which is why I said it. Because of that,
nothing in the stanard basically guarantees anything for the program.
No, you don't get to limit the ways in which that could possibly cause
problems. The program is nonconforming and the compiler is allowed to do
all kinds of strange or not-so-strange things. It isn't required to
operate as otherwise expected up to that point. For example, a compiler
could, in principle, notice the problem and refuse to compile the code.

I agree that this is the real feature that makes the code
nonstandard.  If it were not for that requirement, then I would
think that if the compiler did not execute the loop 6 times, then it
would be a compiler bug.

But, as you say, since it cannot satisfy the N+1 requirement after
the loop, it is allowed to fail in any other way too, including
never exiting the loop (or starting WWIII).

$.02 -Ron Shepard

I see (I think), the problem is that the Do loop control variable
after the loop would have a "wrong" value, which could cause that the
program never starts, for example... how is this explained in the
standard?

Fernando.
.



Relevant Pages

  • 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)
  • Re: Fridays the thirteenth. (And a little puzzle.)
    ... -- compiler) is the usual method ... int febdays ... -- We're going to go round a loop dealing with each year in turn. ... -- other languages call) ...
    (uk.people.silversurfers)
  • Re: Interesting article by Randall Hyde
    ... >>> a test before executing the loop. ... is a compiler writer forced to ... And another thing you might consider is that compiler optimization was ... Then the programmer will have to protect the execution of that loop. ...
    (comp.lang.asm.x86)