From: David Laight <David.Laight@ACULAB.COM>
To: 'Fangrui Song' <maskray@google.com>, Florent Revest <revest@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Joel Fernandes <joel@joelfernandes.org>,
"rcu@vger.kernel.org" <rcu@vger.kernel.org>,
"nathan@kernel.org" <nathan@kernel.org>,
"trix@redhat.com" <trix@redhat.com>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"paulmck@kernel.org" <paulmck@kernel.org>,
"revest@chromium.org" <revest@chromium.org>
Subject: RE: clangd cannot handle tree_nocb.h
Date: Thu, 20 Apr 2023 11:50:57 +0000 [thread overview]
Message-ID: <e6c8e08dfc8a4895aca44571d26fa445@AcuMS.aculab.com> (raw)
In-Reply-To: <CAFP8O3KQRbmgyvuyuxNOa6TZ7MawN7YoGHvpFQ=oibEo3aUfDQ@mail.gmail.com>
From: Fangrui Song
> Sent: 19 April 2023 21:02
....
> Some information about Clang based language servers
>
> It's good practice to ensure that a header file is self-contained. If
> not, for example, if a.c includes a.h, which is not self-contained,
> a.h is generally compiled on its own (as if using clang [options] a.h)
> to confine diagnostics/completion results to a.h and not to other
> headers included by a.c.
>
> However, this design choice may cause language servers to emit
> diagnostics that you don't see when building the project.
That really doesn't work for .h files that contain program
generated data used to initialise arrays.
They may not even contain numbers, just references to
#defines that that including file is expected to define.
So there will always be .h files that are not compilable.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-04-20 11:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 0:53 clangd cannot handle tree_nocb.h Joel Fernandes
2023-04-14 1:11 ` Joel Fernandes
2023-04-14 1:16 ` Joel Fernandes
2023-04-14 22:47 ` Nick Desaulniers
2023-04-18 16:28 ` Nick Desaulniers
2023-04-19 13:00 ` Florent Revest
2023-04-19 20:02 ` Fangrui Song
2023-04-20 11:50 ` David Laight [this message]
2023-04-29 6:18 ` Joel Fernandes
2023-04-18 20:36 ` Joel Fernandes
2023-04-18 20:46 ` Nick Desaulniers
2023-04-18 21:03 ` Joel Fernandes
2023-04-18 21:45 ` Joel Fernandes
2023-04-19 22:55 ` Nick Desaulniers
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=e6c8e08dfc8a4895aca44571d26fa445@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=maskray@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=revest@chromium.org \
--cc=revest@google.com \
--cc=trix@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