public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Martin Sebor <sebor@roguewave.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: libstdc++/9378: 64-bit g++: construct base:std::moneypunct_byname<char>->memory fault
Date: Thu, 30 Jan 2003 01:56:00 -0000	[thread overview]
Message-ID: <20030130015601.11109.qmail@sources.redhat.com> (raw)

The following reply was made to PR libstdc++/9378; it has been noted by GNATS.

From: Martin Sebor <sebor@roguewave.com>
To: Benjamin Kosnik <bkoz@redhat.com>
Cc: bkoz@gcc.gnu.org, axiong@ca.ibm.com, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/9378: 64-bit g++: construct base:std::moneypunct_byname<char>->memory
 fault
Date: Wed, 29 Jan 2003 18:45:32 -0700

 Benjamin Kosnik wrote:
 > On Wed, 29 Jan 2003 14:24:10 -0700
 > Martin Sebor <sebor@roguewave.com> wrote:
 > 
 > 
 >>FWIW, I don't think the requirements on the ctors of class
 >>locale are relevant in this case. The problem is, IMO, that
 >>there are no requirements at all on the ctors of the byname
 >>facets, so pretty much anything goes. I.e., abort is just
 >>as legal as successful construction.
 > 
 > 
 > Hmm. I wasn't paying attention, and didn't realize these were _byname facets. 
 > It doesn't really matter though, because....
 > 
 > 22.1.1.1.2 - Class locale::facet [lib.locale.facet]
 > 
 > -4- For some standard facets a standard ``..._byname'' class, derived
 > from it, implements the virtual function semantics equivalent to that
 > facet of the locale constructed by locale(const char*) with the same
 > name. 
 > 
 > So, with this equivalence argument, I think the original point still
 > holds: these name strings are implementation-defined, and people should
 > not assume that any arbitray string will in fact, lead to a constructed
 > locale object.
 
 I agree (with the name argument). I would go even further and
 assert that programs that directly construct any of the _byname
 facets have unspecified behavior. The only safe (or portable)
 way to use the _byname facets is via a call to use_facet<
 xxx_byname>(), and even that only after a corresponding call
 to has_facet<xxx_byname>()).
 
 In fact, I would even propose that we remove the _byname ctors,
 or better yet, the entire facets from the standard ;-) (only
 half joking).
 
 Regards
 Martin
 


             reply	other threads:[~2003-01-30  1:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-30  1:56 Martin Sebor [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 11:23 steven
2003-01-30  1:56 Benjamin Kosnik
2003-01-30  1:36 Benjamin Kosnik
2003-01-29 21:26 Martin Sebor
2003-01-29 21:05 bkoz
2003-01-21 21:36 axiong
2003-01-21 20:06 Janis Johnson
2003-01-21  6:26 Alan Modra
2003-01-20 20:26 axiong

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=20030130015601.11109.qmail@sources.redhat.com \
    --to=sebor@roguewave.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).