This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: memsetting a locale object
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: bourne at toughguy dot net
- Date: Tue, 12 Nov 2002 23:41:12 -0600 (CST)
- Subject: Re: memsetting a locale object
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
> #include <locale>
> using namespace std;
> int main()
> {
> locale* foobar = new locale("foo");
> memset(foobar,0,sizeof(class locale));
> delete foobar;
> }
As a user of the standard C++ library, it is *never* correct to
externally call memset() on top of a library object properly
constructed by the C++ run-time system. We would not accept any patch
to the library to make the above code "work". This is truly a case
where dumping core is better.
Regards,
Loren