NetBSD-Users archive

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

Re: What is BSD make?



Aleksey Cheusov <cheusov%tut.by@localhost> writes:

> Portability of NetBSD userspace is, in general, bad.

Portability of NetBSD userspace is, in general, good.

> This is because BSD-isms are widely used in it, like strl{cat,cpy}, err, warn,
> wgetln and lots of other. Using these extensions is normal for NetBSD
> because they make code cleaner, shorter and safer.
>
> But this problem may be solved easily by including
>
>   #ifdef HAVE_CONFIG
>   #include <config.h>
>   #endif
>
> to all *.c files. Other problems are already implemented in
> libnbcompat.  Those who will build tools under Solaris/Linux or
> whatever will do this without patching source code, just by creating
> config.h and adding -DHAVE_CONFIG to CPPFLAGS.

This problem is better solved by providing those functions in their libc,
than by working around them in NetBSD code. You should make them convert
to strlcat/strlcpy functions, since they are definitly easier to work with,
than their "n" sisters, and safer at the same time. Same applies to fgetln.

As for your needs, read cpp(1) and find the relevant flag. There's absolutely
no need in polluting code with those gnuisms.

Why can I build NetBSD programs with those functions on Linux and Cygwin,
and you cannot?

JFYI, err/warn family functions are present even in older RH5 releases.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index