From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou 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: Thu, 25 Feb 2016 21:23:18 +0100 Message-ID: <871t801qvd.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ2PZ-0003fU-4e for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:21:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ2PU-00060I-Rc for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:21:21 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:55150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ2PU-00060A-L9 for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:21:16 -0500 In-Reply-To: (Chris Andrews's message of "Tue, 23 Feb 2016 16:45:03 -0600") 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: Chris Andrews Cc: emacs-orgmode@gnu.org 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 convert > 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 from: > > "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. Do you want to provide a patch for that? See for details, if you're interested. Regards, -- Nicolas Goaziou