From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11760 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: stdbool.h does not define _Bool when included by C++ code Date: Mon, 31 Jul 2017 11:18:28 +0200 Message-ID: <20170731091828.GA15263@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1501492725 29723 195.159.176.226 (31 Jul 2017 09:18:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 31 Jul 2017 09:18:45 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) Cc: musl@lists.openwall.com To: Michael Clark Original-X-From: musl-return-11773-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 31 11:18:41 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dc6qW-0007PZ-OS for gllmg-musl@m.gmane.org; Mon, 31 Jul 2017 11:18:40 +0200 Original-Received: (qmail 11669 invoked by uid 550); 31 Jul 2017 09:18:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11648 invoked from network); 31 Jul 2017 09:18:41 -0000 Mail-Followup-To: Michael Clark , musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11760 Archived-At: * Michael Clark [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.