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.user Subject: Re: c99 support Date: Sun, 24 Jun 2018 01:00:43 +0100 Message-ID: <20180624010043.ea673017b13184bedb5bbef6@gmail.com> References: <8736xd45zc.fsf@pobox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1529798351 5301 195.159.176.226 (23 Jun 2018 23:59:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2018 23:59:11 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 24 01:59:07 2018 Return-path: Envelope-to: guile-user@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 1fWsQt-0001K6-3b for guile-user@m.gmane.org; Sun, 24 Jun 2018 01:59:07 +0200 Original-Received: from localhost ([::1]:40083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWsT0-0007FA-6I for guile-user@m.gmane.org; Sat, 23 Jun 2018 20:01:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWsSW-0007D2-4I for guile-user@gnu.org; Sat, 23 Jun 2018 20:00:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWsSV-0000ON-Av for guile-user@gnu.org; Sat, 23 Jun 2018 20:00:48 -0400 Original-Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:37602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWsSV-0000OH-3v for guile-user@gnu.org; Sat, 23 Jun 2018 20:00:47 -0400 Original-Received: by mail-wr0-x229.google.com with SMTP id k6-v6so10020978wrp.4 for ; Sat, 23 Jun 2018 17:00:46 -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=6BICLKgfWXZZ5weA7KllYDG6WUzRcjrsLCGU/DzppAI=; b=np1jAAXLf8CxwbMH/uA5iIyTNo/eIcs0kobs8Y8zA29dX8KS5lKCSSjuEmOj4R26yN UL+QFWgIsWJNEMfmZrC+egv8W3GhcC9BgwzUfzx7u1UmVQX/WKHhUJCOkRdvVgrCYpih Rodn2/CSVQ1FX8M7dWmgEIVLhhtYvQGl/RODyrEQk1xYcwDA1vBBAblhBCxER4i0BStw 56cR/CYYHA7NblWVh3JgLGiT8kBFNaP/kxgahys9hVhaue9wFsJPTyo10nP4+UV8oVHL bm97lsG5CJTMv22RDVlPPwg16ss8c5ABx0HsnnEgNSRM1wB6GPld9LaNWJL6Rj7WPFEK C9jg== 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=6BICLKgfWXZZ5weA7KllYDG6WUzRcjrsLCGU/DzppAI=; b=P71bta1y5AVaY9EdHMFLDZkLahxgMZk77hasqhVNMFOi7+jeuVCc8mrEI9T2ArIED/ NqZiBjS6upu4FLzdQ7wFa1NKuuvxLJ/iIJWH6079zHxhZeznKy1Jwn2gFYRcfjxh/nZH uZW6GQY3niBbcFz7wL3pLaDzxmOp6Wnna4OjhfyqVajc58ITpf/HDCARADAIPS+WsxE+ ZwxwuY/UfgGHUvZ3V0vy+ZvAp2RuHS8oqTV54rEdiNwwI4MyJBl9gdomE27lh1sTSpQA jYhMvAkklYtpBYXCvY/wwkP2dfo4I6xPPkCDNkmY9+S4hc6TWDumGELnyjJdicdp35u4 BDlA== X-Gm-Message-State: APt69E3TeoZ4RjvDyTRbL2P1wv+An8SkqiysncfIqy1lJIHLY8Ec7c7d SzSZJGX8FeZ01g6276NfU0qTpQ== X-Google-Smtp-Source: AAOMgpeZree2Q4KzQciWlwMQ7Rmla4r/CFHgAWHAHVnoPFIy8eHfVn6IrOy6A5CD4XOiLKstmiYkKA== X-Received: by 2002:adf:bb13:: with SMTP id r19-v6mr2439713wrg.244.1529798445567; Sat, 23 Jun 2018 17:00:45 -0700 (PDT) Original-Received: from bother.homenet ([2002:5f92:705d:10:5117:1381:88c9:f9ff]) by smtp.gmail.com with ESMTPSA id k12-v6sm6358292wrr.40.2018.06.23.17.00.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jun 2018 17:00:44 -0700 (PDT) Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with SMTP id 3A625261E95 for ; Sun, 24 Jun 2018 01:00:43 +0100 (BST) In-Reply-To: <8736xd45zc.fsf@pobox.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:c0c::229 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14654 Archived-At: On Sat, 23 Jun 2018 22:12:39 +0200 Andy Wingo wrote: > Hi, > > Is there anyone who compiles Guile with a compiler that does not support > C99? If so, please give platform and compiler. > > I think my questions are limited to, in decreasing order of importance: > > * Is there any system that we target that doesn't have C99 stdint.h > and stddef.h ? > > * Is there any system that we target that doesn't support C99 inline > functions? > > * C99 mixed decls and statements? > > * C99 one-line comments (// foo) ? > > * C99 compound literals? ((struct x) { 1, 2 }) ? > > * stdbool.h > > I would like to use C99 inside Guile, and I want to eventually replace > scm_t_uint8 with uint8_t. I include guile headers in C++11 code. These C99 features seem to be in current C++ (uint8_t is definitely supported if available on the platform), except that my earlier assumption that compound literals were in C++11 was wrong. They do work, but that's because they are a supported gcc, clang and MSVC extension in C++. That's decent coverage though. Although stdbool.h exists in C++11, its contents are signficantly reduced in scope because bool is separately supported in C++. The definitions of bool are different in C99 and C++ - it is an integer type plus macro in C99 - which might cause problems if the sizes of bool in C++ and C99 are different. It would be a very poor implementation which does this, but stdbool.h may be best avoided in a guile header file. This is not relevant if you are only including C99 features in implementation (*.c) files. That will always work OK. Chris