You may well be right I fear, though this is the first time I have encountered a problem with the apparent mismatch. I tracked the error using a debugger to an Rtl CriticalSection function.
And the following version which crudely approximates using fprintf() runs fine:
#! perl -slw use strict; use Inline 'FORCE'; use Inline C => 'DATA', NAME => 'IC_junk1', CLEAN_AFTER_BUILD => 0; test( 'fred' ); test2( 'fred' ); __DATA__ __C__ //#include <stdio.h> void test ( char* text ) { printf( "Got:'%s'\n", text ); printf( "%x\n", stderr ); } void test2 ( char* text ) { char buf[ 255 ]; sprintf( buf, "%s", text ); fputs( stderr, buf ); }
So it does look like some difference in the CRTs that is responsible. I'd swear that I've used fprintf() from inline C before, but a quick scan of my files revealed none and I found a couple that called Perl_warn(), so maybe I encountered and worked around it some time ago and forgot.
In reply to Re^2: Inline C: using stderr segfaults?
by BrowserUk
in thread Inline C: using stderr segfaults?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |