[CLN-list] Overriding read_number_bad_syntax on OS X

Ron Garret ron at flownet.com
Sat May 12 00:28:43 CEST 2007


A few years back I wrote a little app that uses cln on Linux.  I had  
to override the behavior of read_number_bad_syntax and  
read_number_junk so that the app wouldn't quit whenever there was a  
syntax error.  I accomplished that with the following code:

namespace cln {
   void read_number_bad_syntax(const char * string, const char *  
string_limit) {
     throw 0;
   }
   void read_number_junk (const char * string_rest, const char * string,
                          const char* string_limit) {
     throw 0;
   }
}

This worked on Linux.  I am trying to port the code now to OS X 10.4  
and it doesn't work.  The code compiles just fine, but when I run it  
any syntax error invokes the built-in behavior, i.e. the application  
quits.  Since this worked on Linux I am at a loss to figure out how  
to fix it on OS X.  Any hints would be much appreciated.

BTW, is there a reason that the default behavior is to quit rather  
than throw an exception?

Thanks,
Ron Garret



More information about the CLN-list mailing list