[antlr-interest] C-Runtime in C++ prog

Gavin Lambert antlr at mirality.co.nz
Sat Feb 16 15:54:40 PST 2008


At 11:42 17/02/2008, Jim Idle wrote:
 >The function you install must have C linkage, but you should be
 >able to throw an exception if it is compiled with exception
 >handling as the C library does not try to catch anything.

Wouldn't throwing an exception from a rule confuse the runtime 
code?  Since it won't have done any necessary cleanup?

It seems to me it's generally bad practice to let exceptions 
"escape" a particular code layer -- in this case, they probably 
shouldn't cross over the C/C++ boundary.  (It seems just as 
dangerous as letting exceptions cross a module boundary, eg. from 
user code to OS code or from application to library.)



More information about the antlr-interest mailing list