From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dov Grobgeld Subject: org-babel-C-ensure-main-wrap fails unless I add exit(0) Date: Wed, 4 Apr 2012 11:13:51 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae93a122ff19bd604bcd60067 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFLLt-0000yX-F4 for emacs-orgmode@gnu.org; Wed, 04 Apr 2012 04:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFLLm-0007FZ-Lr for emacs-orgmode@gnu.org; Wed, 04 Apr 2012 04:14:01 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:64734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFLLm-0007Et-DI for emacs-orgmode@gnu.org; Wed, 04 Apr 2012 04:13:54 -0400 Received: by obbta14 with SMTP id ta14so9181obb.0 for ; Wed, 04 Apr 2012 01:13:51 -0700 (PDT) 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 --14dae93a122ff19bd604bcd60067 Content-Type: text/plain; charset=UTF-8 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 --14dae93a122ff19bd604bcd60067 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
When running a b= abel 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 prog= ram exits with error code=3D4, which is caught by org-babel-eval and the pr= inted output is not inserted into my buffer . I solved this by adding `#inc= lude <stdlib.h>` and `exit(0);` as part of org-babel-C-ensure-main-wr= ap .

Should I prepare this as patch?

Regards,
Dov

--14dae93a122ff19bd604bcd60067--