From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outbound-ss-820.bluehost.com (outbound-ss-820.bluehost.com [69.89.24.241]) by sourceware.org (Postfix) with ESMTPS id CC32E385770F for ; Wed, 17 May 2023 19:48:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC32E385770F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mad-scientist.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mad-scientist.net Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway2.mail.pro1.eigbox.com (Postfix) with ESMTP id A779510047F8C for ; Wed, 17 May 2023 19:48:12 +0000 (UTC) Received: from box5922.bluehost.com ([162.241.30.80]) by cmsmtp with ESMTP id zN88pbRNPoWVUzN88powSO; Wed, 17 May 2023 19:48:12 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=aeOkITkt c=1 sm=1 tr=0 ts=64652f7c a=u+82WREdhvUKZ7QTvcqjvQ==:117 a=u+82WREdhvUKZ7QTvcqjvQ==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=P0xRbXHiH_UA:10:nop_rcvd_month_year a=3EOfIcITIxQA:10:endurance_base64_authed_username_1 a=x-fJwc_96dymBm7uBMoA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mad-scientist.us; s=default; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:To:Reply-To:From:Subject:Message-ID: Sender:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mQOLsM4PxViWPka1Ch7PBaLW/JgDNDSf8RGpnr0Ci40=; b=Ysn/5rLBLz7pNt8HAayCRHUenW 7DeDat8FXp4cmfxICLk6upXMYP21laXU1s/2/3cN9zUtA6N0GMhLl+yMSv71MgtL8eN96S0WUwVH+ JJPFA6mn5V1eFKKxi5ESwqmfk; Received: from [160.231.0.90] (port=54955 helo=llin-psh13-dsa.dsone.3ds.com) by box5922.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pzN88-002cca-0w; Wed, 17 May 2023 13:48:12 -0600 Message-ID: Subject: Re: LSP based on GCC From: Paul Smith Reply-To: paul@mad-scientist.net To: Eli Zaretskii , gcc@gcc.gnu.org Date: Wed, 17 May 2023 15:48:09 -0400 In-Reply-To: <83a5y3xcai.fsf@gnu.org> References: <83a5y3xcai.fsf@gnu.org> Organization: Please remain calm--I may be mad but I am a professional! Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1 (by Flathub.org) MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5922.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mad-scientist.net X-BWhitelist: no X-Source-IP: 160.231.0.90 X-Source-L: No X-Exim-ID: 1pzN88-002cca-0w X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (llin-psh13-dsa.dsone.3ds.com) [160.231.0.90]:54955 X-Source-Auth: paul@mad-scientist.us X-Email-Count: 1 X-Source-Cap: bWFkc2NpZTE7bWFkc2NpZTE7Ym94NTkyMi5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 2023-05-17 at 17:28 +0300, Eli Zaretskii via Gcc wrote: > If there are no current plans for implementing LSP, I hope someone > will work on that soon, given that Emacs can now use it, and because > having a GCC-based LSP implementation will allow people to use their > installed GCC as the basis for LSP features, instead of having to > install yet another compiler. Just to note, existing LSP servers are stand-alone binaries: you don't need to install the compiler. The two main C/C++ LSP servers I'm aware of are clangd and ccls. Both of them are built from libclang, as you suggest, but you don't need a full clang installation to get them. You do need to install some Clang "resource" header files for intrinsics etc. but not the entire compiler (for example you don't need the STL or anything like that: they do work fine with the GCC STL). Nevertheless I wholeheartedly agree with your hopes Eli because using Clang-based LSP is annoying for people developing with GCC: First, when you're viewing code that is using #ifdefs to choose between compilers you always see the code for Clang as "active", even though you're using GCC as the compiler, since it's using the Clang built-in macros. More frustratingly, Clang has made some poor decisions around "compatibility": they tried to leverage the GNU ecosystem by emulating GCC features and arguments but sometimes break things. The most egregious example I'm aware of is that they look for GCC-named precompiled headers (.gch), even though the Clang PCH format is completely different. So if Clang (and the LSP servers built on it) find a .gch header file they will try to read it, fail, and give an error. I filed a bug about this in 2019 but it's been ignored. This means you need to modify your LSP server arguments to omit any PCH compiler command line arguments; for environments based on auto- generated definitions like compile_commands.json this is frustrating.