mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Michael Clark <michaeljclark@mac.com>
Cc: musl@lists.openwall.com
Subject: Re: stdbool.h does not define _Bool when included by C++ code
Date: Mon, 31 Jul 2017 11:18:28 +0200	[thread overview]
Message-ID: <20170731091828.GA15263@port70.net> (raw)
In-Reply-To: <A256987C-DE95-405D-9F26-3C54CC3B20A2@mac.com>

* Michael Clark <michaeljclark@mac.com> [2017-07-28 22:21:10 +1200]:
> It seems the musl stdbool.h defines bool in terms of _Bool for C, but does not define _Bool in terms of bool for C++.
> 
> The gcc stdbool.h header handles both conditions and when included by C++ code it has #define _Bool bool but notes that it is a GNU extension.
> 

ideally c++ would support all c keywords since c++ programmers
expect c headers to be valid c++ and new c keywords are in the
implementation namespace (except restrict in c99).

then _Bool, _Noreturn, etc in declarations would work in c++
(and it would be a conforming c++ implementation).

c code will use _Bool without including stdbool.h, so defining
it in stdbool.h does not help most uses of _Bool.

iow, this is either a minor gcc bug or a big fat c++ defect
depending on how you look at it, the libc cannot fix this
properly, just emulate the broken nonsense in gcc stdbool.h
that nobody should rely on.


  parent reply	other threads:[~2017-07-31  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 10:21 Michael Clark
2017-07-28 13:01 ` Rich Felker
2017-07-31  9:18 ` Szabolcs Nagy [this message]
2017-07-31  9:46   ` Jens Gustedt
2017-07-31 21:06     ` Michael Clark
2017-08-01  1:31       ` Rich Felker
2017-08-01  7:24         ` Jens Gustedt

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

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

  git send-email \
    --in-reply-to=20170731091828.GA15263@port70.net \
    --to=nsz@port70.net \
    --cc=michaeljclark@mac.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).