[Bug locale/22338] locale: Use the right type for allocation sizes (non-portable assumptions).

carlos at redhat dot com sourceware-bugzilla@sourceware.org
Mon Oct 23 20:49:00 GMT 2017


https://sourceware.org/bugzilla/show_bug.cgi?id=22338

--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Andreas Schwab from comment #1)
> > The oringal code is fine, but it's a non-portable assumption to say that
> > sizeof (foo **) == sizeof (foo *), it could in theory be different.
> 
> Not in GNU C.

OK, in which case there are only 2 other good reasons for changing it:
* some static analysis tooling doesn't know about GNU C and could warn (I've
seen this in coverity).
* it is logically clearer that the size needed is "element size x number of
elements"

Would you object to this kind of change?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list