Re: sane 0.72pre meets FreeBSD

David Mosberger-Tang (David.Mosberger@acm.org)
Sun, 5 Apr 1998 14:00:16 -0700

>>>>> On Sun, 5 Apr 1998 21:21:08 +0200 (CEST), =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= <mikko@securitydynamics.com> said:

Mikko> The patches below are all (?) that is required to compile and
Mikko> pass initial tests on FreeBSD 2.2.5 with gtk 0.99.9 and gimp
Mikko> 0.99.23.

Thanks! I think I got all the fixes in place so hopefully 0.72 will
build out of the box.

Mikko> Question 0:

Mikko> Is the entire build supposed to pass without any compiler
Mikko> warnings?

Yes and no. Yes if you have a modern enough libc that declares all
the necessary function, no in all other cases. "Modern enough" is
roughly equivalent to glibc 2.x.

Mikko> If so, there are a few things that could be improved:

Mikko> - getopt.c does not include headers to get declarations of
Mikko> getpid() and strdup(). Well, it sort of does, but there are
Mikko> enough #ifdefs to make sure it does not happen. But I guess
Mikko> this file is simply grabbed out of GNU libs, and should not
Mikko> be changed. No big deal.

That's intentional. There are systems broken enough that _declare_
certain functions but do not _define_ them in any library (yes, this
is true). Because of this, it's safer not to declare replacement libc
functions at all. The warnings are annoying, but C's parameter
passing rules work in a way that makes this safer.

Mikko> - sane provides strndup() for systems that does not have it,
Mikko> but fails to declare it anywhere. It could be done in
Mikko> config.h, which would require to include <sys/types.h>
Mikko> somewhere too (to get size_t).

This, again is intentional for the above reason. glibc 2.x declares
and defines strndup() so there you won't see any warnings.

Mikko> Question 1:

Mikko> Is it necessary to keep all the loadable backends in the
Mikko> standard library path? I'm getting an uneasy feeling when
Mikko> sane singlehandedly doubles the number of entries in my
Mikko> /usr/local/lib, with something that could be considered as
Mikko> internal to sane.

Mikko> Am I missing something, or could they be moved to (for
Mikko> example) /usr/local/lib/sane/? Aren't the backends just
Mikko> dlopen()ed?

The probably should. There used to be few enough backends that this
didn't matter, but I think you're right that we're getting past this
point. I won't promise it for 0.72 but it's something we should
change (if someone were to send me tested patches, it would accelerate
things a lot, hint, hint... ;-)

--david

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com