bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Exception support in the persistence engine - more info.


From: erik_ohrnberger
Subject: RE: Exception support in the persistence engine - more info.
Date: Wed, 1 Dec 2004 13:54:17 -0500

The reason that I ask is based on a test program that I wrote.

It simply opens an output archive stream, writes a single int value to it,
and closes it.  Then it opens that very stream for read, reads a float.
You'd figure that this would cause some sort of exception, but it does not.

I've repeated the same experiment by writing a vector of 10 ints to the
stream, and then reading back 11 floats.  Still no exception.  I would have
thought that it would be have generated some sort of 'seek beyond end of
file' type of error.

I've repeated the same experiment again, writing a vector of ints, and
reading a map< int, float> back in, and still no error.

Am I missing something here?  Based on these experiment results, it would
appear that using exceptions turns off all error checking and reporting, and
in fact no exceptions are thrown.  This is a bit concerning to me as it
raises the probability of reading in and trying to process corrupt data.

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden
> On Behalf
> Of Erik Ohrnberger
> Sent: Tuesday, November 30, 2004 2:49 PM
> To: address@hidden
> Subject: Exception support in the persistence engine
> 
> 
> Is it just me, or is the exception support in the persistence 
> engine not
> quite ready for prime time yet?
> 
> If it's ready, how to turn it on so that I can use 
> exceptions?  Seems like
> whatever I do to config.h, or configure, the g++ preprocessor 
> throws away
> the THROWS macros.
> 
> Thanks for the assist.
> 
> Erik.
> 
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]