From: James Dennett on
bokiteam(a)ms21.hinet.net wrote:
> I don't have more information either.
>
> It is a embedded code.
>
> I just guess it is often use in C++ coding...

No. The term "panic" I've come across in kernels written in C,
where it stops execution of the whole OS. I've never seen it
used in C++ code. (Note: I'm not saying it is not used, I'm
just saying that in my moderately extensive experience of C++
code it's not been just uncommon but entirely absent.)

-- James
From: Francis Glassborow on
In article <TdLvf.4809$ZA5.1145(a)fed1read05>, James Dennett
<jdennett(a)cox.net> writes
>No. The term "panic" I've come across in kernels written in C,
>where it stops execution of the whole OS. I've never seen it
>used in C++ code. (Note: I'm not saying it is not used, I'm
>just saying that in my moderately extensive experience of C++
>code it's not been just uncommon but entirely absent.)

It used to be conventional that a function that was to be called when a
process arrived at an impossible place was called panic. I.e. when the
programmer believed it was impossible to get where-ever but nonetheless
the program still got there.


--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects
From: James Dennett on
Francis Glassborow wrote:
> In article <TdLvf.4809$ZA5.1145(a)fed1read05>, James Dennett
> <jdennett(a)cox.net> writes
>
>> No. The term "panic" I've come across in kernels written in C,
>> where it stops execution of the whole OS. I've never seen it
>> used in C++ code. (Note: I'm not saying it is not used, I'm
>> just saying that in my moderately extensive experience of C++
>> code it's not been just uncommon but entirely absent.)
>
>
> It used to be conventional that a function that was to be called when a
> process arrived at an impossible place was called panic. I.e. when the
> programmer believed it was impossible to get where-ever but nonetheless
> the program still got there.

Interesting: I much prefer that to the modern practice of
writing assert(false) in theoretically unreachable places.

(I've worked on at least one project where such a function
went by the name of ProcCrash, where Proc was a prefix for
the process-control functions.)

-- James
From: Roberto Waltman on
bokiteam(a)ms21.hinet.net wrote:
>Hi All,
>Here are some routine, I can't understand what are they doing:
>...
>Allocates sz words and returns a pointer to the memory if successful.
>If the memory allocation fails, the application is panicked.
>void *PanicUnlessMalloc(size_t sz);
>
>What is panic here?
>
>"..., the application is panicked."

I do not know the exact origin, but the most
common use of "panic" is in the kernel of
Unix/Linux/etc. operating systems.
(I never saw the term used in application
level code)

When the system detects an error condition
from which it can not recover, it "panics",
i.e. displays and error message and halts
the system.


Roberto Waltman

[ Please reply to the group,
return address is invalid ]
From: bokiteam on
Thank you for information :)

Best regards,
Boki.

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: how to convert integer to string
Next: reinterpret_cast