From: Robert Klemme Date: 2012-08-30T18:22:33+09:00 Subject: Re: Common Traps for C extensions On Thu, Aug 30, 2012 at 9:34 AM, Bernhard Brodowsky wrote: > Hi, thanks for your answer. Somehow it didn't compile as C++ code, if I > do the conversions, Well, as long as we do not see the code and / or the error we can't really tell why it did not compile. I created a test this morning which worked but threw it away. You do need to compile the catching and conversion code with extern "C" with a C++ compiler though. > Exactly, that is what I am talking about, checking for non-null does not > suffice, because Ruby calls my alloc function first, so the pointer is > actually valid, but it points to an uninitialized object. Yeah, but your allocation function could place one or more NULL pointers in the structure which get filled later, couldn't it? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/