Date: Fri, 28 Oct 2022 11:02:16 -0400 From: Rich Felker <dalias@...c.org> To: puwenxu <puwenxu1@...wei.com> Cc: "musl@...ts.openwall.com" <musl@...ts.openwall.com> Subject: Re: 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@...8EB1B.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
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.