From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3D8D3BBAF for ; Tue, 29 Jun 2010 14:45:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMCAKqHKUzZSMDdi2dsb2JhbACfOxUBAQEKCwoHDwUfvw6FJAQ X-IronPort-AV: E=Sophos;i="4.53,505,1272837600"; d="scan'208";a="65550431" Received: from fmmailgate01.web.de ([217.72.192.221]) by mail4-smtp-sop.national.inria.fr with ESMTP; 29 Jun 2010 14:45:32 +0200 Received: from smtp07.web.de ( [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id 19116161F36AA; Tue, 29 Jun 2010 14:45:32 +0200 (CEST) Received: from [91.47.104.188] (helo=[192.168.2.100]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OTaBv-0006bl-00; Tue, 29 Jun 2010 14:45:32 +0200 Message-ID: <4C29EAEB.6040203@web.de> Date: Tue, 29 Jun 2010 14:45:31 +0200 From: Andreas Sommer User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: David Allsopp Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Calling OCaml from C - nothing shown on stdout References: <4C29CE90.60708@web.de> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: AndiDog@web.de X-Sender: AndiDog@web.de X-Provags-ID: V01U2FsdGVkX19xCo+ngOFDylzMKQFdGW9NiWjlIgNP/q7nOxgv ScTmOSjhuqRKHbIqcF2p9jSoK6gWq86dBpFhMlbIEUZ/uRJl44 YXbqRCBU0= X-Spam: no; 0.00; ocaml:01 stdout:01 stdout:01 ocaml:01 runtime:01 printf:01 wrote:01 andreas:01 andreas:01 caml-list:01 functions:01 caml:02 caml:02 native:03 problem:05 David Allsopp wrote: > > > As far as I can tell from the manual, there's no particular difference in native code between using caml_main and caml_startup. Your problem is the buffering of stdout in the OCaml runtime. There are two ways of working around this: > The caml_main and caml_startup functions are indeed identical (caml_startup only calls caml_main). You were right about the stdout buffering, and I will use your flushed_printf solution. Thanks for your help! Andreas