Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170731091828.GA15263@port70.net>
Date: Mon, 31 Jul 2017 11:18:28 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: Michael Clark <michaeljclark@....com>
Cc: musl@...ts.openwall.com
Subject: Re: stdbool.h does not define _Bool when included by C++ code

* Michael Clark <michaeljclark@....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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.