I happened to be looking at some source I have that uses strtonum(3) this morning and I noted I had to define _OPENBSD_SOURCE to make its prototype visible on NetBSD, but not on FreeBSD, nor of course on OpenBSD. On both OpenBSD and FreeBSD it is protected by __BSD_VISIBLE, which is I believe defined by default on both systems (especially if _BSD_SOURCE is defined on OpenBSD). There is no _OPENBSD_SOURCE on OpenBSD. It is purely a NetBSD invention. strfmon(3) is an example of a function taken from FreeBSD that's protected by _NETBSD_SOURCE, not something unique to indicate it came from FreeBSD. Shouldn't strtonum() likewise be protected by _NETBSD_SOURCE on NetBSD? I see reallocarray() has also been added within the _OPENBSD_SOURCE as well, and I think it too should only be protected by _NETBSD_SOURCE. Notably strlcpy() and strlcat() are not protected by this unique _OPENBSD_SOURCE though they both were invented by and taken from OpenBSD. Instead they are protected by _NETBSD_SOURCE. (Maybe _NETBSD_SOURCE should be changed to __BSD_VISIBLE too? There could be some confusion from that I guess given it would offer different symbols on different systems unless there's a _lot_ more coordination and cooperation between the system's developers!) -- Greg A. Woods <gwoods%acm.org@localhost> Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost> Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
Attachment:
pgp93qFcjCWDh.pgp
Description: OpenPGP Digital Signature