[EMAIL PROTECTED] (Ross Ridge) writes: > Well, for example, like all other things that a new_handler can do, > like throwing an exception derived from bad_alloc or calling exit(). > In addition, any number of side effects are possible, like printing > error messages or setting flags.
Gabriel Dos Reis writes: >I believe you're confused about the semantics. >The issue here is that the *size of object* requested can be >represented. That is independent of whether the machine has enough >memory or not. So, new_handler is a red herring The issue is what GCC should do when the calculation of the size of memory to allocate with operator new() results in unsigned wrapping. Currently, GCC's behavior is standard conforming but probably isn't the expected result. If GCC does something other than what operator new() does when there isn't enough memory available then it will be doing something that is both non-conforming and probably not what was expected. Ross Ridge