[cairo] Re: Add missing include of libgen.h for basename (Was Re: [cairo-commit] 4 commits - perf/cairo-perf-diff-files.c pixman/src src/Makefile.am)

Carl Worth cworth at cworth.org
Mon Apr 30 14:12:02 PDT 2007


On Sat, 28 Apr 2007 18:29:11 -0400, Behdad Esfahbod wrote:
> > +#include <libgen.h>
>
> Probably worth a configure check for libgen.h as it's a POSIX header,
> not a C one.

As with most portability issues, I'll gladly accept a patch when
offered, but I don't worry too much in advance.

Oh, and this is the attitude I have for things like "perf", (which
we're discussing here), that are ancillary to the cairo library
itself, (within which we would never even think of using a function
like basename anyway).

Several of the little gotchas in the recent cairo snapshot were things
from perf as well. I don't mind fixing those, but I'm also not sure
that we want to get people hung up on those problems when they're just
trying to build cairo itself. Options could include:

1. Don't compile anything in boilerplate, test, or perf when the user
   just says "make".

2. Start separating some of this stuff out from the library itself.

I think I'd prefer (1) as we're pretty close to that already, aren't
we? Ideas?

> Also, the basename(3) manual says the POSIX version of
> baseline may modify its input string.  Is the code using it prepared for
> that?

Yes, it's quite cautious, acting only on a very short-lived temporary
copy:

	configuration = strdup (filename);
	report->configuration = strdup (basename (configuration));
	free (configuration);

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070430/14ba045f/attachment.pgp


More information about the cairo mailing list