mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Constants to decode __ctype_b_loc() table
Date: Wed, 15 Oct 2014 22:07:12 -0400	[thread overview]
Message-ID: <20141016020712.GV32028@brightrain.aerifal.cx> (raw)
In-Reply-To: <20141016015333.GG4874@port70.net>

On Thu, Oct 16, 2014 at 03:53:33AM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2014-10-15 20:58:43 -0400]:
> > On Wed, Oct 15, 2014 at 10:19:46PM +0300, Sergey Dmitrouk wrote:
> > > hard-wire these constants for generic case, but is it really correct
> > > solution?
> > 
> > No, using those interfaces AT ALL is incorrect. They are not a public
> > API but glibc implementation internals. The correct way to implement
> > the locale functionality in C++ is to call the ctype.h/wctype.h
> > functions, not using glibc implementation internals.
> > 
> 
> i think the c++ std lib has a hard time implementing that efficiently
> (but it should be their problem not ours)
> 
> it has to parse istreams in terms of ctype<> and there are inefficient
> apis like ctype<C>::is(const C*,const C*,mask*) which has to calculate
> the ctype mask for each char in a substring (so calling all is* c apis
> for each char..)

This sounds like an inefficient API to use...

> > > The question is whether you want to keep it in this somewhat incomplete
> > > state, when particular values of constants are assumed and undocumented (e.g.
> > > if this is really just for libstdc++, which can live without constants).
> > 
> > No, the question is whether we want to provide glibc internals as a
> > public API, and the answer is no.
> > 
> 
> well at least one standard specifies __ctype_b_loc
> 
> http://refspecs.linux-foundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html

In the link you cited:

    "This interface is not in the source standard; it is only in the
    binary standard."

Rich


  reply	other threads:[~2014-10-16  2:07 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 [this message]
2014-10-16  8:37               ` Sergey Dmitrouk
2014-10-16 12:21                 ` Szabolcs Nagy
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=20141016020712.GV32028@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).