RPM Community Forums

Mailing List Message of <popt-devel>

Re: Question about the xmalloc() et al functions

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 10 Mar 2008 - 01:27:25 CET
Message-Id: <3A98B78D-89E9-4B44-94C2-863D4F1D806E@mac.com>

On Mar 9, 2008, at 7:59 PM, Wayne Davison wrote:

> On Sun, Mar 09, 2008 at 07:26:31PM -0400, Jeff Johnson wrote:
>> There are some subtleties however with xstrdup. [... mtrace related
>> issues ...]
> Right, that's why I preserved the HAVE_MCHECK_H version using its own
> malloc() call (it's unchanged from your version) and just made the  
> non-
> HAVE_MCHECK_H version add failure checking.  All the other  
> functions are
> the same for both (with exit-on-failure handling).

I'd love to use xmalloc everywhere. Alas, there's still lots of dain  
portability issues, the patches to "fix" portability are usually  
and limited in scope. See e.g. __secure_getenv and the setresgid/ 
"stuff", to name just two. The va_copy() hackery entered popt through  
same Newer! Better! Bestest! window, where popt is now undertaking
iconv conversions and bind_textdomain_codeset() retrofits that
_REALLY_ need to be solved in applications, not in popt.

Using xmalloc just opens up a can-of-worms while lusers fuss about
non-gcc compiler extension portability.

Again, I'd *love* to use xmalloc and xstrdup, I use daily, worksforme.

But at some point, popt should just process options, no fuss, no  
muss, no problems.

73 de Jeff
Received on Mon Mar 10 01:27:36 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.