[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6c8e08dfc8a4895aca44571d26fa445@AcuMS.aculab.com>
Date: Thu, 20 Apr 2023 11:50:57 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Fangrui Song' <maskray@...gle.com>,
Florent Revest <revest@...gle.com>
CC: Nick Desaulniers <ndesaulniers@...gle.com>,
Joel Fernandes <joel@...lfernandes.org>,
"rcu@...r.kernel.org" <rcu@...r.kernel.org>,
"nathan@...nel.org" <nathan@...nel.org>,
"trix@...hat.com" <trix@...hat.com>,
"llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"paulmck@...nel.org" <paulmck@...nel.org>,
"revest@...omium.org" <revest@...omium.org>
Subject: RE: clangd cannot handle tree_nocb.h
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)
Powered by blists - more mailing lists