This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

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


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.

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