Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2025-03-21 Thread Thomas Schwinge
Hi Jason! On 2025-03-20T11:52:46-0400, Jason Merrill wrote: > On 3/19/25 1:35 PM, Thomas Schwinge wrote: >> On 2013-05-03T16:24:43-0400, Jason Merrill wrote: >>> Last year Florian fixed the compiler to detect overflow in array new >>> size calculations and pass (size_t)-1 in that case. But C++1

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2025-03-20 Thread Jason Merrill
On 3/19/25 1:35 PM, Thomas Schwinge wrote: Hi Jason! On 2013-05-03T16:24:43-0400, Jason Merrill wrote: Last year Florian fixed the compiler to detect overflow in array new size calculations and pass (size_t)-1 in that case. But C++11 specifies that in case of overflow the program throws std::

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2025-03-19 Thread Thomas Schwinge
Hi Jason! On 2013-05-03T16:24:43-0400, Jason Merrill wrote: > Last year Florian fixed the compiler to detect overflow in array new > size calculations and pass (size_t)-1 in that case. But C++11 specifies > that in case of overflow the program throws std::bad_array_new_length > (http://www.op

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-13 Thread Florian Weimer
On 05/06/2013 05:56 PM, Jason Merrill wrote: On 05/06/2013 08:46 AM, Florian Weimer wrote: On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the che

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Jason Merrill
On 05/06/2013 08:46 AM, Florian Weimer wrote: On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline function,

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Florian Weimer
On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline function, so that the inliner can decide whether or not

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Jason Merrill
On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline function, so that the inliner can decide whether or not to expand it at the call site... This patc

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Florian Weimer
On 05/03/2013 10:24 PM, Jason Merrill wrote: Last year Florian fixed the compiler to detect overflow in array new size calculations and pass (size_t)-1 in that case. But C++11 specifies that in case of overflow the program throws std::bad_array_new_length (http://www.open-std.org/jtc1/sc22/wg21/