From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: babel C, C++, D enhancement Date: Fri, 13 Jun 2014 08:51:10 +0200 Message-ID: <87ha3p8fq9.fsf@Rainer.invalid> References: <878urc0zmw.fsf@bzg.ath.cx> <874n1ryeq1.fsf@bzg.ath.cx> <87y4xgxu74.fsf@Rainer.invalid> <87r438uycj.fsf@bzg.ath.cx> <538BA215.2050305@free.fr> <877g4uezak.fsf@gmail.com> <5394C55B.7010906@free.fr> <87tx7vq955.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvLKk-0002la-1C for emacs-orgmode@gnu.org; Fri, 13 Jun 2014 02:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvLKd-00048M-ON for emacs-orgmode@gnu.org; Fri, 13 Jun 2014 02:51:29 -0400 Received: from plane.gmane.org ([80.91.229.3]:56159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvLKd-00047E-ER for emacs-orgmode@gnu.org; Fri, 13 Jun 2014 02:51:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WvLKb-0001Bu-QO for emacs-orgmode@gnu.org; Fri, 13 Jun 2014 08:51:21 +0200 Received: from pd9eb038e.dip0.t-ipconnect.de ([217.235.3.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jun 2014 08:51:21 +0200 Received: from Stromeko by pd9eb038e.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jun 2014 08:51:21 +0200 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@gnu.org Eric Schulte writes: > This new patch looks great, and the test suite passes locally. I've > just applied it. You also get a warning from the byte-compiler on something that is clearly a bug. I think the fix should be: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/ob-C.el b/lisp/ob-C.el index dd03fa7..a794e2a 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -264,7 +264,7 @@ (defun org-babel-C-val-to-C-type (val) (list (if (equal org-babel-c-variant 'd) "string" "const char*") "\"%s\"")) - (t (error "unknown type %S" type))))) + (t (error "unknown type %S" basetype))))) (cond ((integerp val) type) ;; an integer declared in the #+begin_src line ((floatp val) type) ;; a numeric declared in the #+begin_src line --8<---------------cut here---------------end--------------->8--- The type determination is a tad optimistic, too. An Emacs integer may or may not fit into C type "int" depending on how Emacs is compiled and which compiler you are using. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf rackAttack: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds