mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: Constants to decode __ctype_b_loc() table
Date: Thu, 16 Oct 2014 14:21:46 +0200	[thread overview]
Message-ID: <20141016122146.GI4874@port70.net> (raw)
In-Reply-To: <20141016083739.GA2525@zx-spectrum.accesssoftek.com>

* Sergey Dmitrouk <sdmitrouk@accesssoftek.com> [2014-10-16 11:37:39 +0300]:
> On Wed, Oct 15, 2014 at 07:07:12PM -0700, Rich Felker wrote:
> > In the link you cited:
> > 
> >     "This interface is not in the source standard; it is only in the
> >     binary standard."
> 
> Even if it's a binary interface, it shouldn't be underspecified.  Right
> now __ctype_b_loc.c contains an array of numbers which correspond to
> what glibc has.  Consider the following situation: glibc changes masks
> at some point, musl doesn't, someone uses masks from new glibc's
> headers after reading a thread like this one and obtains broken locales.

either glibc changes its locale system and keeps __ctype_b_loc around
with the old semantics (which they can do any time) or they change the
semantics of __ctype_b_loc breaking the current abi (which they should
not do)

this is why depending anything in source headers is broken when you
depend on internal abi: internal details of the source can change,
there is no guarantee about them, abi that is visible to existing
binaries cannot change (hopefully)

so libc++ should not use undocumented masks from glibc ctype.h

libc++ should use standard interfaces (that should be the default)
and if it must use __ctype_b_loc then recognize that glibc headers
are not under their control so they have to replicate the bits they
care about

> Having this documented in form of a comment instead of public interface
> would be good as well, in this case clients could consult place where
> it's documented and be sure that their constants are correct.  Say, add
> a comment to __ctype_b_loc.c to clarify meaning of the table and
> document masks at the same time.

i think adding a comment makes sense, but i think we should not
encourage the dependence on accidentally visible abi details of
the libc


  reply	other threads:[~2014-10-16 12:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 10:41 Sergey Dmitrouk
2014-10-15 11:32 ` Szabolcs Nagy
2014-10-15 12:05   ` Sergey Dmitrouk
2014-10-15 16:51     ` Rich Felker
2014-10-15 19:19       ` Sergey Dmitrouk
2014-10-16  0:58         ` Rich Felker
2014-10-16  1:53           ` Szabolcs Nagy
2014-10-16  2:07             ` Rich Felker
2014-10-16  8:37               ` Sergey Dmitrouk
2014-10-16 12:21                 ` Szabolcs Nagy [this message]
2014-10-16 15:37                 ` Rich Felker

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=20141016122146.GI4874@port70.net \
    --to=nsz@port70.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).