All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Julia Lawall <julia.lawall@inria.fr>, Kees Cook <keescook@chromium.org>
Cc: cocci@inria.fr, "Darrick J. Wong" <djwong@kernel.org>
Subject: Re: [cocci] coccinelle is skipping include files?
Date: Wed, 19 Oct 2022 22:18:29 -0700	[thread overview]
Message-ID: <BCF9DF09-DF10-48AC-B689-B97C03900CC5@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2210200639050.2988@hadrien>

On October 19, 2022 9:43:35 PM PDT, Julia Lawall <julia.lawall@inria.fr> wrote:
>> The example I'm looking at is fs/xfs/xfs_bmap_item.c, which starts with:
>> #include "xfs.h"
>> #include "xfs_fs.h"
>> #include "xfs_format.h"
>> #include "xfs_log_format.h"
>> ...
>You may want to start with the option --verbose-includes for such
>problems.

Ah-ha, thanks!

>The problem is that Coccinelle can't find the file.  Your .c file is in
>fs/xfs, and despite the lack of a complete path, the header file is in
>a subdirectory: fs/xfs/libxfs.  So you could add -I fs/xfs/libxfs to your
>command line.

Ugh, yes, I see this now. It looks like we need to parse the Makefiles? :(

>Another solution is the option --relax-include-path.  This should cause
>Coccinelle to look over the entire kernel to see if it can find exactly
>one file named xfs_log_format.h.  If only one exists, that has to be the
>one you want.

Interesting solution, and would work here. I wonder if there needs to be a "fail I Coccinelle fails to find a header" option? Hmmm



-- 
Kees Cook

  reply	other threads:[~2022-10-22  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 23:36 [cocci] coccinelle is skipping include files? Kees Cook
2022-10-20  4:43 ` Julia Lawall
2022-10-20  5:18   ` Kees Cook [this message]
2022-10-20  5:23     ` Julia Lawall
2022-10-24 16:53       ` Kees Cook

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=BCF9DF09-DF10-48AC-B689-B97C03900CC5@kernel.org \
    --to=kees@kernel.org \
    --cc=cocci@inria.fr \
    --cc=djwong@kernel.org \
    --cc=julia.lawall@inria.fr \
    --cc=keescook@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.