From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: Bug: Incorrect type in ob-C.el for D code [8.3.4 (8.3.4-elpa @ ~/.emacs.d/elpa/org-20160222/)] Date: Sun, 20 Mar 2016 15:31:32 +0100 Message-ID: <56EEB444.9020100@free.fr> References: <871t801qvd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030102000600040606090103" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aheOH-0003Yz-KW for emacs-orgmode@gnu.org; Sun, 20 Mar 2016 10:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aheOE-00006z-DD for emacs-orgmode@gnu.org; Sun, 20 Mar 2016 10:31:37 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:9802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aheOE-00006t-4h for emacs-orgmode@gnu.org; Sun, 20 Mar 2016 10:31:34 -0400 Received: from [IPv6:2a01:e35:2e21:def0:9481:6e49:d605:e957] (unknown [IPv6:2a01:e35:2e21:def0:9481:6e49:d605:e957]) by smtp1-g21.free.fr (Postfix) with ESMTP id 513369400B7 for ; Sun, 20 Mar 2016 15:27:56 +0100 (CET) In-Reply-To: <871t801qvd.fsf@nicolasgoaziou.fr> 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 This is a multi-part message in MIME format. --------------030102000600040606090103 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Attached is a patch to keep Babel D compliant with the latest version of the language. Thanks Chris for reporting. Thierry Le 25/02/2016 21:23, Nicolas Goaziou a =E9crit : > Hello, > > Chris Andrews writes: > >> Issue is fairly straightforward. When evaluating a D code block that >> includes a table var, this error is thrown by the DMD compiler. >> >> ~\Temp\babel-1032v-N\C-src-1032Xig.d(25): Error: cannot implicitly con= vert >> expression (row) of type ulong to uint >> Failed: ["dmd", "-v", "-o-", "~/Temp/babel-1032v-N/C-src-1032Xig.d", >> "-I~/Local/Temp/babel-1032v-N"] >> >> The type `ulong` is not appropriate for the generated code, as it >> represents an array index. The fix is to change line 434 in ob-C.el f= rom: >> >> "string %s_h (ulong row, string col) { return >> %s[row][get_column_num(%s_header,col)]; }" >> >> to read: >> >> "string %s_h (size_t row, string col) { return >> %s[row][get_column_num(%s_header,col)]; }" >> >> >> The use of `size_t` is correct for array indexes, and fixes the error = in >> the compiler. > Thank you for the report.=20 > > Do you want to provide a patch for that? See > for details, if you're > interested. > > Regards, > --------------030102000600040606090103 Content-Type: text/x-diff; name="0001-use-size_t-in-babel-D.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-use-size_t-in-babel-D.patch" >From 5f5dbf0a0d0c9cf364c02842f245d4651dac76b8 Mon Sep 17 00:00:00 2001 From: Thierry Banel Date: Sun, 20 Mar 2016 15:24:14 +0100 Subject: [PATCH] use size_t in babel D * lisp/ob-C.el (org-babel-C-header-to-C): change ulong to size_t for indexing a table as mandated by the latest version of the D language (thanks to Chris Andrews) --- lisp/ob-C.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-C.el b/lisp/ob-C.el index dd34b0b..8275313 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -431,7 +431,7 @@ specifying a variable with the name of the table." table table (length headers) table)) (d (format - "string %s_h (ulong row, string col) { return %s[row][get_column_num(%s_header,col)]; }" + "string %s_h (size_t row, string col) { return %s[row][get_column_num(%s_header,col)]; }" table table table)))))) (provide 'ob-C) -- 2.1.4 --------------030102000600040606090103--