https://bugs.kde.org/show_bug.cgi?id=497977

Paul Floyd <pjfl...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pjfl...@wanadoo.fr

--- Comment #5 from Paul Floyd <pjfl...@wanadoo.fr> ---
You are getting it the wrong way round. This error message isn't about library
internals. It's about user code. The kind of thing that this is protecting
against is

https://godbolt.org/z/8e7vrd55j

Because of C's terrible implicit conversions, signed int will convert to size_t
without a squeak.

I agree with Mark that GCC's error is a lot less useful than the Memcheck one
and Philippe that this was done deliberately to detect user bugs. This is a
runtime error, not compile time. We have no way of knowing whether the original
input was signed or unsigned. It's just a bunch of bits.

Trying to allocate 0x8000000000000000 or more is always going to fail. Perhaps
it might be possible with a huge system in maybe 10 or 20 years time.

This is slightly more of an issue on 32bit systems where using more than half
of the VM space for an application is easy these days. Thankfully 32bit systems
are on the way out.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to