473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

exception from C function?

Hello everyone,
As far as I know, C function does not throw exception.

But Bjarne said in his book, section 14.8 Exception and Efficiency,

--------------------
In particular, an implementation knows that only a few standard C
library functions (such as atexit() and qsort()) can throw exceptions,
and it can take advantage of that fact to generate better code.
--------------------

What did he mean? C function could really throw exception? What
exception -- C++ exception or structured exception?
thanks in advance,
George
Jan 28 '08 #1
1 1382
George2 wrote:
As far as I know, C function does not throw exception.

But Bjarne said in his book, section 14.8 Exception and Efficiency,

--------------------
In particular, an implementation knows that only a few standard C
library functions (such as atexit() and qsort()) can throw exceptions,
and it can take advantage of that fact to generate better code.
--------------------

What did he mean? C function could really throw exception? What
exception -- C++ exception or structured exception?
There are no structured exceptions in C++ world (it's a MS Windows specific
thing), so Bjarne meant C++ exceptions.

atexit() and qsort() both take function pointers to callback function that
get called at some time and these functions could throw an exception. So
atexit() and qsort() can indirectly throw exceptions.

--
Thomas
http://www.netmeister.org/news/learn2quote.html
post tenebras lux. post fenestras tux.
Jan 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: StepH | last post by:
Hi, I've this module : from optparse import OptionParser import re _version = "P1" def writeVar(f, line):
1
by: serge calderara | last post by:
Dear all, How can I handle correctly cascading exception? I generally use to catch exception ib all my function. This to identify each type the correct place that the exception occurs. What...
6
by: Páll Ólafsson | last post by:
Hi I have a problem with the Microsoft.ApplicationBlocks.ExceptionManagement? I can't get it to work in RELEASE mode? If I run the project in debug mode the block works fine but when I run the...
3
by: Pierre Rouleau | last post by:
The std::exception class defined in the Standard C++ <exception> header specifies that the constructors could throw any exception becuase they do not have a throw() specification. Why is that? ...
10
by: linq936 | last post by:
Hi, I have many assert() call in my code, now I am considering to replace them with exception. The reason I want to do this change is that with the program going bigger and bigger, it is hard to...
6
by: Steve Long | last post by:
Help, I'm running VS.NET 2003 and when I try to start my application, I get the "unhandled exception" dialog instead of the IDE highlighting the offending line of code. The problem appears to be...
2
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web...
1
by: usenet | last post by:
I wrote some sample code (see below) for nested exception throwing i.e. my catch blocks are throwing exceptions of their own (for simplicity I used standard exceptions). I am getting some...
3
by: Allie | last post by:
Hi, all. I've never been any good at handling exceptions... So I need your help. Within a try{ } block, I have to call a function that has to throw its own exception. How should I go about...
1
by: George2 | last post by:
Hello everyone, Such code segment is used to check whether function call or exception- handling mechanism runs out of memory first (written by Bjarne), void perverted() { try{
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.