From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.devel Subject: Re: c99 support Date: Fri, 29 Jun 2018 11:10:27 +0100 Message-ID: <20180629111027.4f60d93515b457653e24f2bb@gmail.com> References: <8736xd45zc.fsf@pobox.com> <877emi2g9q.fsf@pobox.com> <7E46C070-8ABF-430E-8ACD-6FDE07AD84AF@telia.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530266915 20619 195.159.176.226 (29 Jun 2018 10:08:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Jun 2018 10:08:35 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jun 29 12:08:31 2018 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYqKM-0005Ha-UL for guile-devel@m.gmane.org; Fri, 29 Jun 2018 12:08:31 +0200 Original-Received: from localhost ([::1]:40956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYqMU-0002NW-75 for guile-devel@m.gmane.org; Fri, 29 Jun 2018 06:10:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYqMO-0002NF-Sa for guile-devel@gnu.org; Fri, 29 Jun 2018 06:10:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYqMK-0006yD-J6 for guile-devel@gnu.org; Fri, 29 Jun 2018 06:10:36 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:40577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYqMK-0006wL-62 for guile-devel@gnu.org; Fri, 29 Jun 2018 06:10:32 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id z13-v6so1462343wma.5 for ; Fri, 29 Jun 2018 03:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CoGSPkalohtv89e7M6+wPntWzfGDe7MlfWUIQzMArLY=; b=r3sFi9WHc9lAm9ItdxxGEEhdYmUhFtd3YsbY2JfwYNLKJNVhXUJFG9C0oGQQ5CMwEs cV5yw3/vVq34kdGsAH7iJkCOU5qdfG/xMqpLBwdCGduq00wd5bXcfgrFHULE7u3HbeNo ClJWdrvbIry+mjoEs8waCguE9PpR2oRnuUFDKK9G1Grhgs+YuC/82+vNEJBPXkKrVQT9 GieBphJPUgqah18YjuvABo4lyIj43COiFF9V+FkctYLfUwyzeBUAYVUpVt2L7X50Dngl PV3MYRunw2OsFTU0UxzRfiK20+YR6Xg8VGq2aygpbhEzMPeBfNcwvbuDN17bS3Hob4Fj Hbqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CoGSPkalohtv89e7M6+wPntWzfGDe7MlfWUIQzMArLY=; b=sQUINcTgqV3eucbIIvtLgdINUDz6sedMu9rKypBdxQg1oHZcZXOgFFWyk2x5aB7Ovm 8vcfMOVj03A4PbPdG2i7zbdtSVhXC5aW+8ynD2wpvfhMPsDmeuXL6doevuyi95NLXYnh xNOZ0vVc+XQ2Xo8Pnm2sm7wzL9AyshQ54xlPnBkSYTum3GVVSufj8v2o3pw9gd/4AGYB 7JA+wdMcpcA7nsCIGEVShikMEXLfF8VsMBoNJr9L7U17oWW7cNxHdR5qW0yv3dxFsaQt MIVyn3G929D+sLxIdm1GlSY5kra/1petOV3RBst+ChZidALvrNBfsLUQcUaP+XsDcOu+ lVNQ== X-Gm-Message-State: APt69E2apYKajX1YHIwhsA2BFIEvljxTn+ZkpkRyQFMd8wyaGiDYx9n/ twPlX/r3q/60/wAIKS8CQjpPDA== X-Google-Smtp-Source: AAOMgpcd8wSr12QTJ4AyctjBvGse14PQE9MYq620gETvV/2trMhnZtkESp98uMTZwE2i8ryEWgUOoQ== X-Received: by 2002:a1c:90c2:: with SMTP id s185-v6mr1339070wmd.5.1530267030477; Fri, 29 Jun 2018 03:10:30 -0700 (PDT) Original-Received: from bother.homenet ([95.146.112.93]) by smtp.gmail.com with ESMTPSA id 130-v6sm3097992wmr.1.2018.06.29.03.10.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 03:10:29 -0700 (PDT) Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with SMTP id 36F19265ED3 for ; Fri, 29 Jun 2018 11:10:28 +0100 (BST) In-Reply-To: <7E46C070-8ABF-430E-8ACD-6FDE07AD84AF@telia.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19565 Archived-At: On Fri, 29 Jun 2018 10:39:33 +0200 Hans =C5berg wrote: > > On 29 Jun 2018, at 09:39, Andy Wingo wrote: > >=20 > > It would seem that the first four > > features of C99 are OK for all platforms that we target, with the > > following caveats: > >=20 > > * We should avoid using C++ keywords (e.g. throw) in Guile API files. > >=20 > > * We might want to avoid mixed decls and statements in inline functions > > in Guile API files. > >=20 > > We should probably avoid stdbool.h and compound literals, for C++ > > reasons. >=20 > You might make a separate C++ header: It turned out too complicated for B= ison to maintain the compile as C++ generated C parser. >=20 > > In Guile 3.0 (master branch), the types "scm_t_uint8" and so on are now > > deprecated. My recommendation is that all users switch to use > > e.g. "uint8_t", "ptrdiff_t", etc from instead of the > > scm_t_uint8, etc definitions that they are now using. The definitions > > are compatible on all systems, AFAIU, and on GNU, scm_t_uint8 has long > > been a simple typedef for uint8_t. >=20 > For C++, these are only optional, cf. [1], as they require no padding. So= an alternative is to typedef the obligatory int_fast<2^k>_t types, perhaps= leaving the API unchanged. >=20 > 1. https://en.cppreference.com/w/cpp/types/integer The fixed size integer types are optional in C99/11 also, depending on whether the platform provides a fixed size integer of the type in question without padding and (for negative integers) a two's complement representation. If, say, uint8_t is available in stdint.h for C, it will be available for C++. =A721.4.1/2 of C++17 makes this even more explicit: "The [cstdint] header defines all types and macros the same as the C standard library header ". I imagine guile will not run on any platform that does not support 8 and 32 bit fixed size integers.