Web lists-archives.org

Re: [Mingw-users] GCC 4.3.0 20080502 (alpha) Released -Please helpus test it!




On 2008-05-06 07:06Z, Brian Dessent wrote:
> "Aaron W. LaFramboise" wrote:
> 
>> Can you clarify this case?  The STL generally does not throw exceptions
>> unless the programmer asks it to.  The only unexpected exception
>> situation I can think of is std::bad_alloc.
> 
> The STL is littered with exceptions.

[snip examples] Furthermore, third-party libraries often throw
exceptions when they encounter problems from which they cannot
recover. It's a "best practice" that experts routinely follow.
For example:

http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm
| Usage is safe in the sense that errors cannot be ignored since
| most functions throw C++ exceptions when errors are detected.
| This is also convenient for users because it alleviates the need
| to explicitly check error return codes.

Similarly, in my own C++ code, I frequently write functions that
throw at entry if a precondition isn't met, and throw just before
exit if a postcondition couldn't be established--e.g.,
  std::string s = "File " + input_file_name + " not found";
  throw std::runtime_error(s);
In an msw GUI program I'd catch that, preferably in the message
loop, and pop up a message box. End users see an informative
message, and the program doesn't terminate abruptly: they can
retry the operation with different input, and they don't lose
their unsaved work.

I'm not quarreling with a roadmap that, AIUI, makes significant
progress on most fronts now, and defers the "foreign-frame"
problem for a while longer; I'm only trying to show why that
issue is more common than might be supposed.

On 2008-05-06 05:18Z, Aaron W. LaFramboise wrote:
>
> The users for whom this is problematic will simply have to wait a little
> longer to upgrade; but these are the users who will likely benefit the
> least from the newer versions, as they don't require the newer features
> anyway.

I'd say these things are actually orthogonal:
 - needing to catch C++ exceptions through msw callbacks
 - benefiting from improvements in gcc-4 versus gcc-3

I don't mind waiting a little longer to upgrade the production
compiler for the program I maintain. Already I've used gcc-4.3
to validate my non-GUI unit tests, and it has identified some
latent defects that I've fixed. So I've already benefited from
your work on 4.3; thank you.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users