473,395 Members | 1,696 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,395 software developers and data experts.

to force gcc to emit additional warnings about unhandled exceptions

Hi

Is it possible to force gcc (or xlc) compiler to emit compilation
warning or compilation error for such code:

void fooA() throw (MyException)
{
...
throw MyException();
...
}

void fooB() throw()
{
fooB();
}

I would like to be warned that in function fooB:
* there is no appropriate catch block to catch MyException from fooA
.... or ...
* fooB should be declared as: void fooB() throw(MyException)

Any idea to force the compiler to emit such warnings?

Kind regards,
Adam
Mar 11 '08 #1
3 2059
ad*****@gmail.com wrote:
Is it possible to force gcc (or xlc) compiler to emit compilation
warning or compilation error for such code:
[..]
This is a compiler-specific question and should be asked in the
newsgroup dedicated to that compiler. Tool invokation is not
on topic here. This is a language newsgroup.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 11 '08 #2
In article <f38e370c-1f1c-44d6-85ed-
9b**********@d45g2000hsc.googlegroups.com>, ja*********@gmail.com
says...

[ ... ]
No. "throw()" guarantees absolutely that the function will
never exit via an exception. §15.4/8,9:
I'm not sure what I was thinking when I said otherwise, but you're
obviously correct.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Mar 15 '08 #3
On 15 mar, 19:22, Jerry Coffin <jcof...@taeus.comwrote:
In article <f38e370c-1f1c-44d6-85ed-
9bd87d765...@d45g2000hsc.googlegroups.com>, james.ka...@gmail.com
says...
[ ... ]
No. "throw()" guarantees absolutely that the function will
never exit via an exception. §15.4/8,9:
I'm not sure what I was thinking when I said otherwise, but you're
obviously correct.
An earlier draft of the standard? I too seem to recall having
seen something similar---that regardless of the exception
specification, std::bad_exception could propagate. I wasn't the
only one, however, who found it totally unacceptable, and it
didn't make it into the final version of the standard.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Mar 16 '08 #4

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

Similar topics

2
by: DEK | last post by:
I'm creating a dynamic assembly which has one type with one constructor, the type inherits a base class Season, which is in the current assembly. I am trying to emit a constructor which simply...
4
by: Frank | last post by:
Hi, I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. In VB6 there was a setting (errortrapping) about handling errors in the design...
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
5
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can...
5
by: Sam Loveridge | last post by:
Hi All. I'm hoping someone can point me in the direction of a solution to unhandled exceptions in MDI child forms causing the application to crash. I've found various articles describing a...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
6
by: LorcanM | last post by:
Hello, I use pdb under Linux to debug my Python code, as in: python -m pdb myprogram.py By default it does a postmortem of unhandled exceptions, is there a way to get it to break on...
20
by: joseph_gallagher | last post by:
Hi, I've recently ported a .Net 1.1 application to .Net 2.0 and the one new feature that is getting on my nerves is that when there is an unhandled exception the application completely crashes,...
1
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi all, I have got my windows app to handled any UI or unhandled exceptions. following is the code static class Program { /// <summary> /// The main entry point for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.