From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11761 Path: news.gmane.org!.POSTED!not-for-mail From: Jens Gustedt 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:46:23 +0200 Organization: inria.fr Message-ID: <20170731114623.0a449442@inria.fr> References: <20170731091828.GA15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/+KBoDC2jiKO8gLau49heLyG"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1501494398 18921 195.159.176.226 (31 Jul 2017 09:46:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 31 Jul 2017 09:46:38 +0000 (UTC) Cc: musl@lists.openwall.com, Michael Clark Original-X-From: musl-return-11774-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 31 11:46:33 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 1dc7HU-0004f2-JE for gllmg-musl@m.gmane.org; Mon, 31 Jul 2017 11:46:32 +0200 Original-Received: (qmail 28540 invoked by uid 550); 31 Jul 2017 09:46:36 -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 28519 invoked from network); 31 Jul 2017 09:46:35 -0000 X-IronPort-AV: E=Sophos;i="5.40,441,1496095200"; d="scan'208";a="285515555" In-Reply-To: <20170731091828.GA15263@port70.net> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ Xref: news.gmane.org gmane.linux.lib.musl.general:11761 Archived-At: --Sig_/+KBoDC2jiKO8gLau49heLyG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, On Mon, 31 Jul 2017 11:18:28 +0200 Szabolcs Nagy wrote: > 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. Basically stdbool.h is already a header to accomodate C++ usage of bool, false and true to C. I makes not much sense to include this in C++ code. I think that applications that want to be shure that their code compiles for both should use "bool" and should do #ifndef __cplusplus # include #endif We can put more comfort into this by lifting this #ifndef/#endif stuff to the contents of the file, if people really want this. But code that relies on this would not be guaranteed to be portable. Using "bool" by means of the header is the intended usage, these attrocities such as _Bool, _Noreturn etc are only there for backwards compatibility. Hopefully at least some of them will be phased out in the future. I think we should not encourage the usage of these keywords in application code unless this is needed for backwards compatibility, nor should we try to impose their possible usage into other languages. Jens --=20 :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/+KBoDC2jiKO8gLau49heLyG Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCWX78bwAKCRAP0+hp2tU3 4kiNAJsEptDPwYOVSWm+4uRsgRqJMgXDUACfb8XCAhSDkgDvUnfQLLr6R9RCWDg= =2AST -----END PGP SIGNATURE----- --Sig_/+KBoDC2jiKO8gLau49heLyG--