tech-userlevel archive

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

Re: strsuftoi(3), strsuftou(3) proposal in libc



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 30.10.2015 16:53, J. Lewis Muir wrote:
> On 10/30/15 7:16 AM, Jan Danielsson wrote:
>> I recall some discussion (on this list, I think) years ago on
>> the topic of creating a libc extensions library which was
>> specifically meant for becoming a portability library for common
>> libc extensions. As I remember it, it was one of those
>> discussions where there was pretty much uniform consensus that it
>> was a good idea, but I think the discussion started to fade away
>> when someone brought up maintainability of such a library
>> (keeping it in-tree, but at the same time keeping it as a
>> separate project).
>> 
>> Perhaps it's time to revisit this idea?
> 
> +1
> 
> If I sit down to write a portable program, I try to avoid
> nonportable functions even if they're better. :-(  I wish it wasn't
> like that. Yes, I could try to pull the desired functions out of
> NetBSD libc or wherever, but that's more work, I'm duplicating
> code, and I have to maintain my copy of it (i.e. track and merge
> changes).  If there was a nice libc extensions portability library
> that was offered as a separate project, that would be *really nice*
> to just use.  I assume the functions would need to be prefixed with
> "nb_" or something to give them a unique namespace so that if a
> function became part of a standard and eventually appeared in libc,
> it would not conflict with the one in the portability library.
> Then I could modify my program to use the libc function (without
> the "nb_" prefix) at my leisure.
> 
> And there could of course be a package for it in pkgsrc, and the
> package for my portable program could just depend on it in pkgsrc.
> Very nice.
> 
> On the other hand, I understand that it would require effort for
> the NetBSD developers to maintain such a portability library if it
> was determined to be a good idea.
> 
> Regards,
> 
> Lewis
> 

It's already done - libnbcompat in pkgsrc. Just write your program
with NetBSD libc API and use libnbcompat for whatever POSIX-like
platform. This is how I'm doing it - no big magic.

The only limitation is that it's incomplete and some of our functions
require long long or *int*_t features.

POSIX and ANSI C aren't the only standards around.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWNp/KAAoJEEuzCOmwLnZsH8YQALv9TXFk3lPO9WLwVaiZGsNg
Pm1yvt+solzaAYBvW5C/jHIsIqYnXIcH3GNZq+dfDge2eUmw7srOMmW/s2dzPpb4
/X/RZh84Z+K8h6OycFkDS6kmNxsOIApUS/IC6X/+ke5q7dFQhnVbxmP+A+j3jnmT
uFWC/LWxdN+aq2grL0eVS0YoKisdQVMWVxXaHVE9aw70HeZ8Sr8ckTLO/LDrc94S
FrvqI/L/uJpNMqg/7FKTAEouIoZNeQx/pzFscng3TyCK01AzWXBb2wQ3DEfIWGVB
HHjZe4KxgsYVStjhAIhYYBAvMhnESGVI4F0CXjYWxMIE1l1Qw7tMnb6ySk/RXKUP
esdbveVqmUqqozDTUbARaoYsKJPksOLnEPQoXngIWStGamEILsPbUDEnxKq3R1zq
KJSX0VwFjvQEj1Xpu+DWzqWN4j0ej6E3xQB7JzBMaCx0TxrNr5Lb/a76d3kErxqm
HDua96zyDfFwFR6RC9eYWSBGWMTfiFKCEjexfEmihysATQaKokmfmexs3PA+xRdk
a+a9hxX5rh8krf6b61RtYoSuT0Fpv1RsAHtDHUvNIQCfI0J0qfuSFmuk6k7OSyoK
PKfGp3KuIxxR4yp7FAdvjjj13Vq0FCZr3fYX+gcHoIeTOZhfdrpFpHjBbYuA+usX
chxpf7grLfczCv+18mHH
=xHGt
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index