mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] guard isascii() macro when using C++
Date: Tue, 5 Jan 2021 11:54:14 +0100	[thread overview]
Message-ID: <20210105105414.GA2006@voyager> (raw)
In-Reply-To: <20210105014834.13622-1-ericonr@disroot.org>

On Mon, Jan 04, 2021 at 10:48:34PM -0300, Érico Nogueira wrote:
> From: Érico Rolim <ericonr@disroot.org>
>
> otherwise one can get compilation errors in C++ code that uses isascii
> as an identifier
>

Well, this is a namespacing issue. The identifier in contention here is
only exposed if defines are set identifying the source file as POSIX
code. POSIX specifies the isascii macro, though it marks it as obsolete.
However, it means that no-one, C or C++, can use isascii as identifier
when including ctype.h if they declare POSIX compatibility. So one of
those three things has to go: Either the source files in question must
avoid including ctype.h, or they must avoid using the isascii
identifier, or they must avoid declaring POSIX compatibility. In all
cases, this is not a C vs. C++ issue, only a namespacing issue. And not
wrong in the library, but in the application.

Ciao,
Markus

      reply	other threads:[~2021-01-05 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  1:48 Érico Nogueira
2021-01-05 10:54 ` Markus Wichmann [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=20210105105414.GA2006@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.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).