From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 888ff3755d4 1/3: New function internal--c-header-file-path Date: Mon, 06 Jan 2025 22:28:48 +0200 Message-ID: <864j2b660v.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13690"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 06 21:30:33 2025 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 1tUtk9-0003Qx-Hr for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jan 2025 21:30:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUtjE-00058y-UF; Mon, 06 Jan 2025 15:29:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUtjA-00058l-SU for emacs-devel@gnu.org; Mon, 06 Jan 2025 15:29:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUtj9-00068t-MS; Mon, 06 Jan 2025 15:29:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=Y6e/jWjoLM5JMd9ovwa+l+VuahBlaNsrLjZmA0DGM2c=; b=sH4rPTeC29wzfi sfeScfgrLQJzgV4YuY0LEjFwHbiJj68TBLJhvNnYwZ0eT94BmvL8m6Q7GadNsIpEyWFZPON9FDYiQ pVDOHIDK0zESba6ushG29xXUU79hieWE0V9N/Jr0Q9x560OGwaBlHbyBenus2XvXRfL0zXmo78XJJ SEnNLM+lrY0RHy6ZIssuovoB9D+vicpoPVER+4ffDbn3gvjeaEMiAIn9f0RNFIZBOrZYLREHTYhEZ UFxiFd2CtWC0u5W7X36/4ABf4nc6XQ6Q9EZDnSpHPYSpDXhyGGkIHX3cGe6eeUhPIcpEGIAvN/yPx pHaXYFS0qWpmeoKgiatw==; 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327750 Archived-At: Stefan, Thanks for adding this function. However, the method it uses to find the include directories is incorrect and unportable. On most systems it will produce the default "/usr/include", which is most probably wrong. The way to ask GCC to show the list of directories where it looks for header files is like this: (call-process "gcc" nil BUFFER nil "-v" "-E" "-") and then look in BUFFER for text that begins with "#include <...> search starts here:" and ends with "End of search list." What's in-between is the list of include directories, one directory per line, which GCC searches for header file, in the order it searches them.