From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Thomas Haller <thaller@redhat.com>
Cc: NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nft v2 0/4] [RESENT] remove xfree() and add free_const()+nft_gmp_free()
Date: Thu, 9 Nov 2023 20:15:55 +0100 [thread overview]
Message-ID: <ZU0v60ai0StX0ktF@calendula> (raw)
In-Reply-To: <76fee659f586988888d1805c5a69627dda5c4f03.camel@redhat.com>
On Thu, Nov 09, 2023 at 06:14:56PM +0100, Thomas Haller wrote:
> On Thu, 2023-11-09 at 17:05 +0100, Pablo Neira Ayuso wrote:
[...]
> > I might end up myself using
> > free_const() everywhere not to figure out if it is const or not,
> > because I don't really care.
>
> That seems not a good practice. Const-correctness may help you to catch
> bugs via unwanted modifications. If constness is unnecessarily cast
> away, it's looses such hints from the compiler.
Why should I care if the pointer is const or not if what I need to
free it?
next prev parent reply other threads:[~2023-11-09 19:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 9:57 [PATCH nft v2 0/4] [RESENT] remove xfree() and add free_const()+nft_gmp_free() Thomas Haller
2023-10-24 9:57 ` [PATCH nft v2 1/4] datatype: don't return a const string from cgroupv2_get_path() Thomas Haller
2023-10-24 9:57 ` [PATCH nft v2 2/4] gmputil: add nft_gmp_free() to free strings from mpz_get_str() Thomas Haller
2023-10-24 9:57 ` [PATCH nft v2 3/4] all: add free_const() and use it instead of xfree() Thomas Haller
2023-10-24 9:57 ` [PATCH nft v2 4/4] all: remove xfree() and use plain free() Thomas Haller
2023-11-06 13:35 ` [PATCH nft v2 0/4] [RESENT] remove xfree() and add free_const()+nft_gmp_free() Pablo Neira Ayuso
2023-11-09 16:05 ` Pablo Neira Ayuso
2023-11-09 17:14 ` Thomas Haller
2023-11-09 19:15 ` Pablo Neira Ayuso [this message]
2023-11-09 20:02 ` Thomas Haller
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZU0v60ai0StX0ktF@calendula \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=thaller@redhat.com \
/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 NNTP newsgroup(s).