From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dov Grobgeld Subject: Re: org-babel-C-ensure-main-wrap fails unless I add exit(0) Date: Thu, 5 Apr 2012 08:25:16 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae93a122fde9b5204bce7c391 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFfCB-0006VA-Ta for emacs-orgmode@gnu.org; Thu, 05 Apr 2012 01:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFfCA-0005U7-CJ for emacs-orgmode@gnu.org; Thu, 05 Apr 2012 01:25:19 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:55337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFfCA-0005U3-50 for emacs-orgmode@gnu.org; Thu, 05 Apr 2012 01:25:18 -0400 Received: by obbta14 with SMTP id ta14so1603440obb.0 for ; Wed, 04 Apr 2012 22:25:16 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --14dae93a122fde9b5204bce7c391 Content-Type: text/plain; charset=UTF-8 Oops. I sawthat I wrote "do not get any error" though I meant "do not get any resulting output". On Wed, Apr 4, 2012 at 11:13, Dov Grobgeld wrote: > When running a babel C session under Linux/gcc I do not get any error > unless I add exit(0) as part of the C-code snippet. For some to me not > understood reason my program exits with error code=4, which is caught by > org-babel-eval and the printed output is not inserted into my buffer . I > solved this by adding `#include ` and `exit(0);` as part of > org-babel-C-ensure-main-wrap . > > Should I prepare this as patch? > > Regards, > Dov > > --14dae93a122fde9b5204bce7c391 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Oops. I sawthat= =C2=A0 I wrote "do not get any error" though I meant "do not= get any resulting output".

O= n Wed, Apr 4, 2012 at 11:13, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:=
When running a babel C session under Linux/gcc I do not get = any error unless I add exit(0) as part of the C-code snippet. For some to m= e not understood reason my program exits with error code=3D4, which is caug= ht by org-babel-eval and the printed output is not inserted into my buffer = . I solved this by adding `#include <stdlib.h>` and `exit(0);` as par= t of org-babel-C-ensure-main-wrap .

Should I prepare this as patch?

Regards,
Dov


--14dae93a122fde9b5204bce7c391--