verify float number

C

Chris Torek

Chris Torek said:
setjmp comes pretty close, doesn't it?

Close enough to make a big mess, certainly.
...and its prohibition almost invariably appears on page 1 of any COBOL
in-house coding standards document. :)

One might wish for the same with regard to setjmp(). Or perhaps
longjmp() -- setjmp() without longjmp() is quite harmless. :)
 
R

Richard Tobin

Alas, C lacks assigned goto (although GNUC provides it, with
the unary && operator to take the address of labels).
[/QUOTE]
setjmp comes pretty close, doesn't it?

In the few circumstances I've encountered where you would want an
assigned goto - the obvious one is a "threaded code" virtual machine -
setjmp() is useless, and the usual approach is to use a big switch
statement instead. If you could rely on your compiler to do
tail-call optimisation, you might be able to use function calls.

-- Richard
 
R

Richard Heathfield

Chris Torek said:
One might wish for the same with regard to setjmp(). Or perhaps
longjmp() -- setjmp() without longjmp() is quite harmless. :)

IME, setjmp/longjmp *are* often deprecated or forbidden in in-house coding
standards docs. Alas, this doesn't seem to have much effect on people. They
say something like "Yes, I know the style doc says don't use longjmp,
*but*....", and then leave others to debug the resulting pigs' breakfast.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
 
R

Richard Bos

Dave Thompson said:
On 25 Oct 2006 01:01:24 -0700, "Nick Keighley"


Maybe a dozen places, or even more, but only as many as you can write
out in one statement, and anyone can easily find the list in a single
place, even a reviewer or maintainer or other such troublemaker.

Now, _assigned_ goto, that's the ticket. And usually with only little
effort you can trash the bits and go to places that aren't labels, nor
even statements, and if you're lucky nor even instructions.

Sinclair Basic had _proper_ computed goto. You could GOTO 2000+100*N!
That was really useful for breaking maintainability.

Richard
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top