unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guile-user@gnu.org
Cc: guile-devel@gnu.org
Subject: Re: c99 support
Date: Fri, 29 Jun 2018 09:39:13 +0200	[thread overview]
Message-ID: <877emi2g9q.fsf@pobox.com> (raw)
In-Reply-To: <8736xd45zc.fsf@pobox.com> (Andy Wingo's message of "Sat, 23 Jun 2018 22:12:39 +0200")

On Sat 23 Jun 2018 22:12, Andy Wingo <wingo@pobox.com> writes:

> 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.

Thanks all for the responses.  It would seem that the first four
features of C99 are OK for all platforms that we target, with the
following caveats:

 * We should avoid using C++ keywords (e.g. throw) in Guile API files.

 * We might want to avoid mixed decls and statements in inline functions
   in Guile API files.

We should probably avoid stdbool.h and compound literals, for C++
reasons.

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 <stdint.h> 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.

If you make the change while targetting current Guile (2.2), then you'll
won't have deprecation warnings when 3.0 comes out.

Cheers,

Andy



       reply	other threads:[~2018-06-29  7:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8736xd45zc.fsf@pobox.com>
2018-06-29  7:39 ` Andy Wingo [this message]
2018-06-29  8:39   ` c99 support Hans Åberg
2018-06-29 10:10     ` Chris Vine
2018-06-29 10:34       ` Hans Åberg
2018-06-29 15:35         ` Chris Vine
2018-06-29 15:55           ` Hans Åberg
2018-06-23 19:11 Andy Wingo
2018-06-23 19:23 ` Eli Zaretskii
2018-06-23 20:07   ` Andy Wingo
2018-06-24  2:37     ` Eli Zaretskii
2018-06-24 11:54 ` Jan Nieuwenhuizen
2018-06-26  0:47 ` Greg Troxel
2018-06-26  8:04   ` Alexander Nasonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877emi2g9q.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).