This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wconversion versus libstdc++


Paolo Carlini <pcarlini@suse.de> writes:

[...]

| In summary, for v3, one possibility could be combining the two
| quantities, consistently for all the containers, thus, essentially,
| compute container::max_size as min(allocator::max_size,
| numeric_limits<difference_type>::max) (all the computations modulo
| sizeof(T)). In this way, we could be sure that, in vector for example,
| substracting the _M_start and _M_finish pointers doesn't overflow a
| ptrdiff_t (the latter finally is casted to a size_t in order to call
| allocator::deallocate). Do you agree with opening a separare v3 PR and
| tackling it along this route?

Yes; and we should have a LWG issue for clarification.  Howard?


-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]