Re: a bit about gnome-libs



On 29 Dec 1998, Ulrich Drepper wrote:
> I took a brief look at the Gnome libs.  The first thing to report is
> the bug with alloca in popt I mentioned some time ago.  I append a
> patch below (including an optimization for glibc 2.1).

Is there any advantage to using stack allocation routines, aside from the
fact that you don't have to free() the results?

In any case, a configure.in check for strdupa should probably accompany
this patch, and do a s/ifdef strdupa/ifdef HAVE_STRDUPA/


> The second point is that there are lots of uses of strtok() in the
> libraries.  I think libraries should be designed right from the
> beginning to be thread-safe.  Therefore use strtok_r() or strsep().  A
> replacement for system which do not have any of these functions is
> easily written.

Yuck.:)

g_strsplit() or smart use of g_strdelimit() may be preferred
for GNOME hackers, since they are guaranteed to exist on all systems.

	Jeff







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