public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
[not found] <bug-44647-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-05 9:42 ` paolo at gcc dot gnu.org
2010-10-05 9:44 ` paolo.carlini at oracle dot com
2010-10-05 9:44 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2010-10-05 9:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2010-10-05 09:42:03 UTC ---
Author: paolo
Date: Tue Oct 5 09:41:57 2010
New Revision: 164973
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164973
Log:
2010-10-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/44647
* libsupc++/Makefile.am (sources): Add bad_alloc.cc.
* libsupc++/new_handler.cc (bad_alloc): Move to ...
* libsupc++/bad_alloc.cc (bad_alloc): ... here, new file.
* libsupc++/Makefile.in: Regenerate.
Added:
trunk/libstdc++-v3/libsupc++/bad_alloc.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/libsupc++/Makefile.am
trunk/libstdc++-v3/libsupc++/Makefile.in
trunk/libstdc++-v3/libsupc++/new_handler.cc
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
[not found] <bug-44647-4@http.gcc.gnu.org/bugzilla/>
2010-10-05 9:42 ` [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled paolo at gcc dot gnu.org
@ 2010-10-05 9:44 ` paolo.carlini at oracle dot com
2010-10-05 9:44 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-05 9:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.0
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-05 09:43:57 UTC ---
Done.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
[not found] <bug-44647-4@http.gcc.gnu.org/bugzilla/>
2010-10-05 9:42 ` [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled paolo at gcc dot gnu.org
2010-10-05 9:44 ` paolo.carlini at oracle dot com
@ 2010-10-05 9:44 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-05 9:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-05 09:44:53 UTC ---
.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
` (3 preceding siblings ...)
2010-06-23 15:20 ` sebastian dot huber at embedded-brains dot de
@ 2010-06-23 15:24 ` redi at gcc dot gnu dot org
4 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-06-23 15:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from redi at gcc dot gnu dot org 2010-06-23 15:24 -------
leave it to me (apart from not including the re-generated autoconf file, your
patch doesn't update the Copyright dates)
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |redi at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-06-23 15:14:45 |2010-06-23 15:24:06
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
` (2 preceding siblings ...)
2010-06-23 15:14 ` redi at gcc dot gnu dot org
@ 2010-06-23 15:20 ` sebastian dot huber at embedded-brains dot de
2010-06-23 15:24 ` redi at gcc dot gnu dot org
4 siblings, 0 replies; 8+ messages in thread
From: sebastian dot huber at embedded-brains dot de @ 2010-06-23 15:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from sebastian dot huber at embedded-brains dot de 2010-06-23 15:20 -------
Created an attachment (id=20987)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20987&action=view)
Moves std::bad_alloc implementation into new file bad_alloc.cc
I don't know how to regenerate the Makefile.in. A simple automake invocation
changes a lot in the Makefile.in.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
2010-06-23 14:57 ` [Bug libstdc++/44647] " redi at gcc dot gnu dot org
2010-06-23 15:02 ` sebastian dot huber at embedded-brains dot de
@ 2010-06-23 15:14 ` redi at gcc dot gnu dot org
2010-06-23 15:20 ` sebastian dot huber at embedded-brains dot de
2010-06-23 15:24 ` redi at gcc dot gnu dot org
4 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-06-23 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from redi at gcc dot gnu dot org 2010-06-23 15:14 -------
OK, now I understand what you're suggesting.
Confirmed as a valid enhancement request.
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-06-23 15:14:45
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
2010-06-23 14:57 ` [Bug libstdc++/44647] " redi at gcc dot gnu dot org
@ 2010-06-23 15:02 ` sebastian dot huber at embedded-brains dot de
2010-06-23 15:14 ` redi at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: sebastian dot huber at embedded-brains dot de @ 2010-06-23 15:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from sebastian dot huber at embedded-brains dot de 2010-06-23 15:02 -------
(In reply to comment #1)
> (In reply to comment #0)
> > The std::bad_alloc definitions should be placed into a
> > separate file.
>
> IIUC that wouldn't work, <new> is required to declare bad_alloc, so if
> bad_alloc was moved to a separate file, the parts of the library which need
> nothrow_t, new_handler and operator new etc. would still have to include <new>,
> which would still have to include bad_alloc.
>
> The way to achieve what you want is to put everything except bad_alloc in a
> separate file, and include that file instead of <new> when bad_alloc is not
> needed.
>
There is nothing wrong with <new>. The problem is new_handler.cc.
Suppose you use
#include <new>
int *p = new (std::nothrow) int;
this will use the operator new implementation in new_opnt.cc. This one uses
__new_handler which is now coupled with std::bad_alloc.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
@ 2010-06-23 14:57 ` redi at gcc dot gnu dot org
2010-06-23 15:02 ` sebastian dot huber at embedded-brains dot de
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-06-23 14:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from redi at gcc dot gnu dot org 2010-06-23 14:57 -------
(In reply to comment #0)
> The std::bad_alloc definitions should be placed into a
> separate file.
IIUC that wouldn't work, <new> is required to declare bad_alloc, so if
bad_alloc was moved to a separate file, the parts of the library which need
nothrow_t, new_handler and operator new etc. would still have to include <new>,
which would still have to include bad_alloc.
The way to achieve what you want is to put everything except bad_alloc in a
separate file, and include that file instead of <new> when bad_alloc is not
needed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44647
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-10-05 9:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-44647-4@http.gcc.gnu.org/bugzilla/>
2010-10-05 9:42 ` [Bug libstdc++/44647] std::nothrow and std::bad_alloc are coupled paolo at gcc dot gnu.org
2010-10-05 9:44 ` paolo.carlini at oracle dot com
2010-10-05 9:44 ` paolo.carlini at oracle dot com
2010-06-23 14:35 [Bug libstdc++/44647] New: " sebastian dot huber at embedded-brains dot de
2010-06-23 14:57 ` [Bug libstdc++/44647] " redi at gcc dot gnu dot org
2010-06-23 15:02 ` sebastian dot huber at embedded-brains dot de
2010-06-23 15:14 ` redi at gcc dot gnu dot org
2010-06-23 15:20 ` sebastian dot huber at embedded-brains dot de
2010-06-23 15:24 ` redi at gcc dot gnu dot org
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).