pkgsrc-Changes archive

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

Re: CVS commit: pkgsrc/net/nsd



Hi,

Sorry. I have missed your e-mail.

Greg Troxel <gdt%lexort.com@localhost> writes:

>   And I dislike "warning: implicit declaration of function" messages.
>
>   How to fix this problem?
>
> Sure, many people don't like that either!
>
> If you include the right header, and don't define any visibility
> defines, then typically things like strlcpy appear just fine.
>
> The problem is if someone defines _XOPEN_SOURCE to some level, that is
> not really so much a request to make that level of XOPEN available as a
> request to hide everything that is not specified by that version of
> XOPEN.  The point is to detect use of things beyond the standard, so
> that the program will build on all other conforming platforms.  And
> thus, assuming this hypothetical, if strlcpy isn't in XOPEN, then it
> can't be used.
>
>   For example, initgroups(e) is defined in /usr/include/unistd.h like:
>   #if defined(_NETBSD_SOURCE)
>   (snip)
>   int      initgroups(const char *, gid_t);
>
> Yes, but if there are no visibility defines, _NETBSD_SOURCE will be
> defined by default.
>
> Looking in the sources, there are all sorts of visibility defines.  See
> config.h.in.
>
> I did the configure phase, and removed all the visibility defines, and
> then built.
>
> The only symbol that was not defined was reallocarray, which is an
> OpenBSD thing, and for that one needs _OPENBSD_SOURCE.  As far as I know
> reallocarray is not defined by any standard.
>
> So, this is an upstream bug, and should be addressed upstream.  I think
> they should just remove all the defines, and only set them on specific
> operating systems where they are really necessary.  Most operating
> systems provide symbols from all standards by default.
>
> I am not really clear on the portable rules for reallocarray.   On
> NetBSD it needs _OPENBSD_SOURCE, and I don't know if it needs that on
> OpenBSD, on which other platforms it is available, and what one needs to
> do there.
>
> It might be reasonable to have _OPENBSD_SOURCE defined only on NetBSD,
> and to not define any other defines otherwise.

_XOPEN_SOURCE or something is defined in wrong way.
I will investigate why _NETBSD_SOURCE is not defined.

Thanks for your input.

-- 
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3



Home | Main Index | Thread Index | Old Index