From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs + bear + compile_commands.json + clangd Date: Wed, 12 Oct 2022 06:32:34 +0200 Message-ID: References: <87pmezvw4p.fsf@rfc20.org> <87k056w9b1.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel To: Matt Armstrong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 12 06:34:04 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oiTRU-0004PA-0r for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Oct 2022 06:34:04 +0200 Original-Received: from localhost ([::1]:53756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiTRS-0006TE-MR for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Oct 2022 00:34:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiTQ8-0005Ol-SG for emacs-devel@gnu.org; Wed, 12 Oct 2022 00:32:40 -0400 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:40543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiTQ7-0003Hg-47 for emacs-devel@gnu.org; Wed, 12 Oct 2022 00:32:40 -0400 Original-Received: by mail-ej1-x62c.google.com with SMTP id r17so35486033eja.7 for ; Tue, 11 Oct 2022 21:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9gMAu96K84bN2fgEh45MVLgLyEbDS8EFtHEOESoNxE0=; b=jQJTgg4a9dAIpBiqgMRXPTEskAjCo+abitXn/60WMJ4198naVnW2SBylFJVgd2oalB 8kVhujuD4xPa0hzcq/TIP3PEbshTLp6hmt6/XwaddTLfCC6zBkPcx0xQtxO1rjD4UUPN wnjSLfiYckz/emSpCe9usdB5OBGP3kG3BIrz1hTmDRVQ+Mu97CGiL/SvBP0fnLzSyOYV HiNPevYWaGPfXDbE8r6yGvPknU4BZ08yp6n1pi5aL8e0iZ125XAtlTaTKCgqbwjo4gY4 HoiVNqq97rIOhLKS1FVct6ZMi5euFC/N2B8c4CMtlwMbGi/mD8K56EhlwSyB4Gxivf7A nzxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9gMAu96K84bN2fgEh45MVLgLyEbDS8EFtHEOESoNxE0=; b=F7+8imXBtfgKJZg1FGOFw5w1Cf+UtEczicSH07+r+jXHC3TmoEPw1CDppTIWQRiHyK 2wPjDrnV6Th5MPRFwuGrnStaxiqal9TvwnBkRwbq6pSc176nR8FvqNlgxBfIE3LrQ0S5 ymi2qU+Vmept0u6QfulsSv5uMhqDo3a6Z1KfT8kQGJmZNIZ5uU5XlBUld32+SwbZfC74 bG3fnZ8LhPtFGW3ILJduVJVOJEhWjrk9IE8CSvFlzlKXX2Wqkybg/YVEZ48bd1Af+KRI wo2uhFKGSdZw2AyGAd9+WQmHYcp+MyJw58abdiiz0jvvLO7nX10u08Ao+7EZeyCc6tEV F3sg== X-Gm-Message-State: ACrzQf0JwrToOvc2LNWNSAf1erSh8TA1VppbuhLzGyFTwlxVvBpCYnLR ILFkulC75W2G0tgc1iPNGQ8lYM3nmTo= X-Google-Smtp-Source: AMsMyM56lkPNV+g/bWE0fenOQDrVwuXIXRO3/PfJ5UMs9AIIbPvUT8s2DkfnyFLYUk/oiNh5WHAjmQ== X-Received: by 2002:a17:906:6a1a:b0:78c:fa9c:e621 with SMTP id qw26-20020a1709066a1a00b0078cfa9ce621mr21777338ejc.160.1665549156667; Tue, 11 Oct 2022 21:32:36 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36de8.dip0.t-ipconnect.de. [217.227.109.232]) by smtp.gmail.com with ESMTPSA id q26-20020aa7d45a000000b0045b4b67156fsm8354049edr.45.2022.10.11.21.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 21:32:35 -0700 (PDT) In-Reply-To: <87k056w9b1.fsf@rfc20.org> (Matt Armstrong's message of "Tue, 11 Oct 2022 10:37:38 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297565 Archived-At: Matt Armstrong writes: >> I've never had to use --force-wrapper or alter compile_commands.json. > > Regarding compile_commands.json, if I use the compile_commands.json > generated by bear, with eglot, with clangd version "Debian clangd > version 14.0.6-2", it works well for .c files but not .h files. > > E.g. I open src/buffer.h and I get these errors in flymake (this is a > small subset): > > 26 9 error e-f-b clang [unknown_typename]: In included file: u= nknown type name 'INLINE_HEADER_BEGIN' > 1 0 error e-f-b clang [fatal_too_many_errors]: Too many error= s emitted, stopping now > 283 4 error e-f-b clang [unknown_typename]: Unknown type name '= INTERVAL' > 722 9 warning e-f-b clang [-Wimplicit-function-declaration]: Impl= icit declaration of function 'PSEUDOVECTORP' is invalid in C99 > 877 5 warning e-f-b clang [-Wimplicit-function-declaration]: Impl= icit declaration of function 'NILP' is invalid in C99 > 1079 26 error e-f-b clang [expr_not_ice]: Expression is not an in= teger constant expression > 1256 7 error e-f-b clang [unknown_typename]: Unknown type name '= INTERVAL' > 1573 14 warning e-f-b clang [-Wint-conversion]: Incompatible intege= r to pointer conversion initializing 'Lisp_Object' (aka 'struct Lisp_X *') = with an expression of type 'int' > 1573 21 warning e-f-b clang [-Wimplicit-function-declaration]: Impl= icit declaration of function 'CHAR_TABLE_REF' is invalid in C99 > > I always assumed that this was becuase clangd didn't know how to compile > src/buffer.h and is unable to figure it out: > > Given all this I have no idea how your experience with clangd could > different, but I'm not a clangd expert =F0=9F=A4=94. I'm not an expert for anything, but I don't see such errors here. Strange. >> My current version is bear 3.0.20, on macOS 12.6. What's your system? > > bear 3.0.20 on Debian/Bullseye (testing) Thanks. > > My issue may have been related to building with Address Sanitizer, which > I think also (might) play games with LD_PRELOAD. I tried > --force-wrapper and it worked for me. ;-) :-). And BTW, I'm also using ASAN here, almost all the time, and don't see this either. This is with the system compiler, which is Apple clang version 14.0.0 (clang-1400.0.29.102). Maybe I'll try the lldb from LLVM 15 a try at some point.