From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: babel C, C++, D enhancement Date: Tue, 17 Jun 2014 22:51:04 +0200 Message-ID: <53A0AA38.4010100@free.fr> 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> <87ha3p8fq9.fsf@Rainer.invalid> <539B762F.90406@free.fr> <878uowpv4b.fsf@Rainer.invalid> <539F5842.2060209@free.fr> <87k38f78yx.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx0LX-0003Qj-Oo for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 16:51:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wx0LS-00065y-E3 for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 16:51:11 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:47148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx0LS-00063o-95 for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 16:51:06 -0400 Received: from [IPv6:2a01:e35:2e21:def0:fdbc:d4f7:34a8:3c2b] (unknown [IPv6:2a01:e35:2e21:def0:fdbc:d4f7:34a8:3c2b]) by smtp1-g21.free.fr (Postfix) with ESMTP id DE3E594016F for ; Tue, 17 Jun 2014 22:51:04 +0200 (CEST) In-Reply-To: <87k38f78yx.fsf@Rainer.invalid> 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 Le 17/06/2014 19:16, Achim Gratz a =E9crit : > Thierry Banel writes: >> You are right, INT_MAX is the C++ constant to compare to. >> It is defined in limits.h >> >> I'm not sure I want to locate limits.h (where is it ? are there severa= l >> versions ?), >> and parse it, all from within Emacs-lisp... > No, this isn't something you should even try. The only method that is > known to work is what autoconf does: compile a program and check the > output. Absolutely right. Or use "getconf INT_MAX" as suggested by Nick Dokos, but this does not works everywhere. >> And this will have to be done for all languages (Python, Perl, Java, >> and so on), not just C++. > Let's stick with C(++) and solve that problem first, that there is a lo= t > of boilerplate code in Babel language support that should be lifted off > elsewhere is a discussion for another time. I do agree. By the way, other languages may not be as tricky. - Java specifies int to be exactly 32 bits, long to be 64 bits. http://en.wikibooks.org/wiki/Java_Programming/Primitive_Types - Same goes for D. http://dlang.org/type.html - In C++ there is a new specification with types like: |int_least32_t| // at least 32 bits |int32_t // exactly 32 bits| http://en.cppreference.com/w/cpp/types/integer >> Or we could assume that INT_MAX is always 2147483647. >> (Which of course is not true). > You've just made compilers customizable. For a start, make those > constants customizable per compiler as well? > Thomas S. Dye suggested just that. Should we throw this detail at the user ? She will have a hard time figuring out why we bother her with integer siz= e. Regards Thierry