git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Derrick Stolee" <derrickstolee@github.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 0/2] git-compat-util.h: change UNUSED(var) to UNUSED
Date: Thu, 25 Aug 2022 19:09:47 +0200	[thread overview]
Message-ID: <cover-0.2-00000000000-20220825T170709Z-avarab@gmail.com> (raw)
In-Reply-To: <xmqq1qt4486e.fsf@gitster.g>

On Thu, Aug 25 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> What's happening here is that coccinelle can no longer properly parse
>> the file after the UNUSED() macros were applied to refs.c.
>
> Sigh.
>
>>      diff --git a/refs.c b/refs.c
>>      index 607694c2662..37e7d88920c 100644
>>      --- a/refs.c
>>      +++ b/refs.c
>>      @@ -442,7 +442,7 @@ struct warn_if_dangling_data {
>>       };
>>
>>       static int warn_if_dangling_symref(const char *refname,
>>      -                                  const struct object_id *UNUSED(oid),
>>      +                                  const struct object_id *oid UNUSED2,
>>                                         int flags, void *cb_data)
>>       {
>>              struct warn_if_dangling_data *d = cb_data;
>
> This is almost "the most simple and stupid and nobody would get
> confused" version, which I may actually be able to live with.
>
> Unfortunately it will not get the "somebody by mistake uses 'oid'
> and we can break the build no matter what compiler is used by them
> before sending the patch out to the list".
>
> Doing s/oid UNUSED2/oid_UNUSED/ without any __attribute__((unused))
> would give that benefit to us, but that won't squelch compilation
> with -Wunused which makes it a non-starter.

I think per the 2/2 that it should be OK, but if you still think it's
a non-starter we'll need some other approach.

When I merge this with "seen" it suggests no "unused.cocci" changes to
refs.c anymore, i.e. it unbroke the interaction between the UNUSED
topic in next and the change that happened to reveal it.

Ævar Arnfjörð Bjarmason (2):
  git-compat-util.h: use "UNUSED", not "UNUSED(var)"
  git-compat-util.h: use "deprecated" for UNUSED variables

 add-interactive.c           |  2 +-
 archive-tar.c               |  4 ++--
 archive-zip.c               |  4 ++--
 archive.c                   |  2 +-
 attr.c                      |  4 ++--
 bisect.c                    |  6 +++---
 bloom.c                     |  4 ++--
 builtin/am.c                |  2 +-
 builtin/bisect--helper.c    | 12 ++++++------
 builtin/checkout.c          |  4 ++--
 builtin/commit-graph.c      |  2 +-
 builtin/config.c            |  6 +++---
 builtin/describe.c          |  4 ++--
 builtin/difftool.c          | 10 +++++-----
 builtin/fast-export.c       |  2 +-
 builtin/fast-import.c       |  2 +-
 builtin/fetch.c             |  8 ++++----
 builtin/fsck.c              | 12 ++++++------
 builtin/gc.c                |  4 ++--
 builtin/log.c               |  4 ++--
 builtin/ls-tree.c           | 10 +++++-----
 builtin/multi-pack-index.c  |  2 +-
 builtin/name-rev.c          |  2 +-
 builtin/pack-objects.c      | 12 ++++++------
 builtin/receive-pack.c      |  4 ++--
 builtin/reflog.c            |  4 ++--
 builtin/remote.c            | 14 +++++++-------
 builtin/repack.c            |  4 ++--
 builtin/rev-parse.c         |  4 ++--
 builtin/show-branch.c       |  6 +++---
 builtin/show-ref.c          |  6 +++---
 builtin/stash.c             | 12 ++++++------
 builtin/submodule--helper.c |  4 ++--
 color.c                     |  2 +-
 commit-graph.c              |  4 ++--
 commit.c                    |  6 +++---
 compat/terminal.c           |  2 +-
 config.c                    |  8 ++++----
 convert.c                   |  4 ++--
 delta-islands.c             |  4 ++--
 diff.c                      |  4 ++--
 dir.c                       |  4 ++--
 environment.c               |  4 ++--
 fetch-pack.c                | 12 ++++++------
 git-compat-util.h           | 13 +++++++------
 gpg-interface.c             |  2 +-
 hashmap.c                   | 10 +++++-----
 help.c                      |  4 ++--
 http-backend.c              |  2 +-
 ident.c                     |  2 +-
 ll-merge.c                  |  2 +-
 log-tree.c                  |  2 +-
 ls-refs.c                   |  2 +-
 merge-recursive.c           | 12 ++++++------
 name-hash.c                 |  4 ++--
 negotiator/default.c        |  4 ++--
 negotiator/skipping.c       |  4 ++--
 notes.c                     |  4 ++--
 object-name.c               | 12 ++++++------
 object-store.h              |  2 +-
 oidmap.c                    |  2 +-
 packfile.c                  |  2 +-
 pager.c                     |  2 +-
 patch-ids.c                 |  2 +-
 pretty.c                    |  2 +-
 range-diff.c                |  2 +-
 ref-filter.c                |  2 +-
 reflog.c                    | 18 +++++++++---------
 refs.c                      | 12 ++++++------
 refs/files-backend.c        | 14 +++++++-------
 refs/iterator.c             |  6 +++---
 refs/packed-backend.c       | 16 ++++++++--------
 remote.c                    | 24 ++++++++++++------------
 replace-object.c            |  4 ++--
 revision.c                  | 18 +++++++++---------
 send-pack.c                 |  2 +-
 sequencer.c                 |  4 ++--
 server-info.c               |  2 +-
 shallow.c                   | 10 +++++-----
 strbuf.c                    |  2 +-
 streaming.c                 |  6 +++---
 strmap.c                    |  4 ++--
 sub-process.c               |  4 ++--
 submodule-config.c          |  8 ++++----
 submodule.c                 | 12 ++++++------
 t/helper/test-config.c      |  2 +-
 t/helper/test-ref-store.c   |  4 ++--
 t/helper/test-userdiff.c    |  2 +-
 trailer.c                   |  4 ++--
 transport.c                 |  2 +-
 upload-pack.c               |  6 +++---
 walker.c                    |  6 +++---
 wt-status.c                 | 16 ++++++++--------
 93 files changed, 270 insertions(+), 269 deletions(-)

-- 
2.37.2.1279.g8741a0e3ea3


  reply	other threads:[~2022-08-25 17:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 17:28 [PATCH] ci: update 'static-analysis' to Ubuntu 22.04 Derrick Stolee via GitGitGadget
2022-08-24 14:40 ` Johannes Schindelin
2022-08-24 19:59   ` Junio C Hamano
2022-08-24 23:43 ` Junio C Hamano
2022-08-25  0:30   ` Derrick Stolee
2022-08-25  4:43     ` Junio C Hamano
2022-08-25 10:47       ` Ævar Arnfjörð Bjarmason
2022-08-25 16:08         ` Junio C Hamano
2022-08-25 17:09           ` Ævar Arnfjörð Bjarmason [this message]
2022-08-25 17:09             ` [PATCH 1/2] git-compat-util.h: use "UNUSED", not "UNUSED(var)" Ævar Arnfjörð Bjarmason
2022-08-25 17:09             ` [PATCH 2/2] git-compat-util.h: use "deprecated" for UNUSED variables Ævar Arnfjörð Bjarmason
2022-08-26  7:52             ` [PATCH 0/2] git-compat-util.h: change UNUSED(var) to UNUSED Jeff King
2022-08-26  7:48         ` [PATCH] ci: update 'static-analysis' to Ubuntu 22.04 Jeff King
2022-08-26 16:46           ` Junio C Hamano
2022-08-27 12:58             ` Jeff King
2022-08-29  5:56               ` Junio C Hamano
2022-08-29 10:29             ` Ævar Arnfjörð Bjarmason
2022-08-31 15:12               ` Jeff King
2022-08-31  8:44             ` SZEDER Gábor
2022-08-31 12:13               ` Ævar Arnfjörð Bjarmason
2022-08-31 15:24                 ` Jeff King
2022-08-31 19:19                   ` Junio C Hamano
2022-08-31 18:05                 ` SZEDER Gábor
2022-08-31 19:29                   ` Ævar Arnfjörð Bjarmason
2022-08-25 14:57 ` Ævar Arnfjörð Bjarmason
2022-08-25 16:17   ` Junio C Hamano

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=cover-0.2-00000000000-20220825T170709Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.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).