From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20845 invoked from network); 28 Oct 2022 15:02:33 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 28 Oct 2022 15:02:33 -0000 Received: (qmail 1907 invoked by uid 550); 28 Oct 2022 15:02:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1875 invoked from network); 28 Oct 2022 15:02:27 -0000 Date: Fri, 28 Oct 2022 11:02:16 -0400 From: Rich Felker To: puwenxu Cc: "musl@lists.openwall.com" Message-ID: <20221028150216.GZ29905@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Questions on commit 98e688a9da5e7b2925dda17a2d6820dddf1fb287 On Fri, Oct 28, 2022 at 02:20:50PM +0000, puwenxu wrote: > Dear maintainer, > As you can see in the pictures, the commit 98e688a9da5e7b2925dda17a2d6820dddf1fb287 modified the codes related to macro __cpluscplus. > [cid:image005.png@01D8EB1B.83A5DFC0] > During my usage of musl, I found that if the macro __cplusplus had > not been defined, the compilation will fail, and report error on > __cplusplus. I am very puzzled about this commit, I think this > modification doesn't take the condition that the __cplusplus hasn't > been defined into consideration. I'm eager to know why. Because the definition of how the preprocessor works is that identifiers without definitions expand to the token 0. You didn't include any information about your compilation environment, so it sounds like either: - you have a buggy compiler that doesn't honor the language spec (unlikely), or - you have enabled a warning that doesn't like this expansion, have told the compiler to treat warnings as errors, and are using a weird compiler invocation where it's not aware that this is a system header (since normally compilers suppress such warnings for system headers). Since it's probably the latter, I would recommend trying to figure out what's wrong with your compiler invocation, since it could indicate that you're trying to use musl with a compiler toolchain targeting a different libc, which could have all sorts of other hidden problems you haven't seen yet. Rich