From: Bruno Haible <bruno@clisp.org>
To: Simon Josefsson <simon@josefsson.org>
Cc: bug-gnulib@gnu.org
Subject: Re: RFC: add a string-desc module
Date: Wed, 29 Mar 2023 00:49:40 +0200 [thread overview]
Message-ID: <6304475.zE8UqtGg2D@nimes> (raw)
In-Reply-To: <87cz4uijos.fsf@kaka.sjd.se>
Simon Josefsson wrote:
> I think this is a useful contribution,
Thanks.
> however I see two deal-breakers
> for having it in gnulib -- both related to use in libraries. I think
> string helpers types/functions like this is useful not only in
> applications but also in libraries. Thus:
>
> 1) License - there really isn't much novelty here, how about making
> this public domain or LGPLv2+?
Not public domain — it does not protect the user from patent claims.
Not MIT license — I don't intend to make gifts to proprietary software
vendors. It's bad enough that some companies ignore the requirements
of the GPL. <https://www.youtube.com/watch?v=5rgsXq2e7Ck>
I've put the core module under LGPLv3+.
If you want it under LGPLv2+, it would be OK for my part, but we would
have to relax the 'memrchr' module to LGPLv2+ first.
> 2) Applicability to use in a library - using x*alloc and abort is
> frowned upon in libraries. Libraries should return error codes on
> expected errors (and I argue memory allocation failure is an expected
> error), and not cause application exits.
Done by separating library-safe memory allocations and checked memory
allocations into separate modules.
> One way to resolve 2) is to have two variants of this functionality: one
> low-level variant that doesn't abort the application on errors, and one
> high-level variant that behaves like your implementation. The
> high-level variant could depend on the low-level variant, but that's not
> essential.
Yes, that's how I did it, for the most part. I couldn't do this so easily
for the string_desc_concat function, though, due to varargs.
Bruno
prev parent reply other threads:[~2023-03-28 22:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 21:50 RFC: add a string-desc module Bruno Haible
2023-03-24 22:32 ` Paul Eggert
2023-03-25 11:39 ` Bruno Haible
2023-03-24 23:20 ` Jeffrey Walton
2023-03-25 6:25 ` Vivien Kraus
2023-03-25 11:49 ` Bruno Haible
2023-03-25 15:51 ` Paul Eggert
2023-03-28 22:40 ` Bruno Haible
2023-03-25 6:21 ` Vivien Kraus
2023-03-25 11:56 ` Bruno Haible
2023-03-27 10:15 ` Simon Josefsson via Gnulib discussion list
2023-03-28 22:49 ` Bruno Haible [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6304475.zE8UqtGg2D@nimes \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=simon@josefsson.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).