Re: [PATCH 1/1] imap-send: include strbuf.h

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

 



On Wed, May 17, 2023 at 12:02:04PM -0400, Taylor Blau wrote:
> > I know there are many header file shuffling patches flying around, and
> > I have seen some of them, but is this a fix for one of these patches?
>
> Similar to [1], this bisects to ba3d1c73da (treewide: remove unnecessary
> cache.h includes, 2023-02-24).

I'm looking through other files to see if we have other uses of the
strbuf API that are hidden behind a #define without a corresponding
#include "strbuf.h".

Here's the (gross) script I wrote up to check:

    git grep -l -e '[^_]xstrdup(' -e 'strbuf_[a-z0-9A-Z_]*(' \*.c |
    while read f
    do
        if ! gcc -I $(pwd) -E $f | grep -q 'struct strbuf {'
        then
            echo "==> $f NOT OK";
        fi
    done

Here's the list:

  ==> compat/fsmonitor/fsm-listen-darwin.c NOT OK
  ==> compat/mingw.c NOT OK
  ==> contrib/credential/osxkeychain/git-credential-osxkeychain.c NOT OK
  ==> pager.c NOT OK
  ==> refs/iterator.c NOT OK
  ==> refs/ref-cache.c NOT OK
  ==> string-list.c NOT OK
  ==> t/helper/test-mktemp.c NOT OK

The ones in compat are OK to ignore since they both fail to compile on
my non-Windows machine (I am missing the `<dispatch/dispatch.h>` and
`<windows.h>` headers, respectively).

The one in contrib is fine to ignore, since it has its own definition of
xstrdup().

pager.c is OK, since it only needs xstrdup(), not any other parts of the
strbuf API. It gets a declaration of xstrdup() from git-compat-util.h
refs/iterator.c, refs/ref-cache.c, string-list.c, and
t/helper/test-mktemp.c are all OK for the same reason.

So I think that this is the only spot we need to worry about.

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux