mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: puwenxu <puwenxu1@huawei.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: [musl] Questions on commit 98e688a9da5e7b2925dda17a2d6820dddf1fb287
Date: Fri, 28 Oct 2022 11:02:16 -0400	[thread overview]
Message-ID: <20221028150216.GZ29905@brightrain.aerifal.cx> (raw)
In-Reply-To: <e5ac7a212c514302b3cc6655f15e628b@huawei.com>

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

      reply	other threads:[~2022-10-28 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 14:20 puwenxu
2022-10-28 15:02 ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221028150216.GZ29905@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=puwenxu1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).