[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Bob Friesenhahn
Subject: Re:
Date: Wed, 31 Mar 2004 17:06:33 -0600 (CST)

On Wed, 31 Mar 2004, Gary V.Vaughan wrote:
> > The style of this change confuses me, and it doesn't seem to do
> > exactly the same thing:
> >
> >    /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory.  */
> >    if (!argz_len)
> > -    LT_DLFREE (argz);
> > +    argz = (free (argz), (char *) 0);
> Actually, they are exactly the same after cpp is done!

Yes, it guess it is valid C code.

> Gnu programmers are used to the xmalloc api, and it is reimplemented all
> over the place, and lowers the barrier for contributing, so I'm inclined
> to reuse the idiom if possible.  When it comes to splitting out xalloc

GNU programmers are not the only users of libtool and libltdl.

> functions, we can leave them static and #include "xalloc.c" into ltdl.c.
> Eventually I'd like there to be enough sanity in libltdl source that

It is really poor form to include .c files into .c files.  While it is
true that a number of projects do that (FreeType and libwmf come to
mind), it can cause problems for some tools, particularly automated
Makefile generators or other tools that place significance on files
based on their extension.

> someone with a reasonable familiarity with the GNU programming style and
> idioms could get to grips with ltdl.c in a few hours... the first step
> is eliminating as much macro noise, and not-invented-here-isms as I can.

In some ways the macroized version looks cleaner.

Bob Friesenhahn

reply via email to

[Prev in Thread] Current Thread [Next in Thread]