From: Efraim Flashner <efraim@flashner.co.il>
To: Andy Wingo <wingo@igalia.com>
Cc: 22186@debbugs.gnu.org
Subject: bug#22186: Use {C,CPLUS,OBJC}_INCLUDE_PATH instead of CPATH
Date: Wed, 16 Dec 2015 22:18:37 +0200 [thread overview]
Message-ID: <20151216221837.588bacf3@debian-netbook> (raw)
In-Reply-To: <871tama22g.fsf@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 2455 bytes --]
On Wed, 16 Dec 2015 14:41:11 +0000
Andy Wingo <wingo@igalia.com> wrote:
> Hi,
>
> I am building GDB from git, because I want to hack on GDB. I have a few
> build-related things in my profile, including GCC. I enter an
> environment for GDB like this:
>
> guix environment gdb --ad-hoc flex autoconf-2.64
>
> Cool. Very good. I build:
>
> mkdir +2.0
> cd +2.0
> ../configure --prefix=/opt/gdb
> make
>
[...]
> The answer is interesting! I quote the GCC manual, section "Environment
> Variables":
>
> Some additional environment variables affect the behavior of the
> preprocessor.
>
> 'CPATH'
> 'C_INCLUDE_PATH'
> 'CPLUS_INCLUDE_PATH'
> 'OBJC_INCLUDE_PATH'
[...]
>
> So! CPATH is like -I but C_INCLUDE_PATH et al are like -isystem.
> Here's the docs for -isystem ("Preprocessor Options"):
>
> '-isystem DIR'
> Search DIR for header files, after all directories specified by
> '-I' but before the standard system directories. Mark it as a
> system directory, so that it gets the same special treatment as is
> applied to the standard system directories. If DIR begins with
> '=', then the '=' will be replaced by the sysroot prefix; see
> '--sysroot' and '-isysroot'.
>
> What is a system directory? Well, it's searched for after all -I
> includes, but also header files in it are marked as system headers.
> Many warnings are not issued for system headers; search the manual for
> the phrase "system headers". For example:
>
> '-Wsystem-headers'
> Issue warnings for code in system headers. These are normally
> unhelpful in finding bugs in your own code, therefore suppressed.
> If you are responsible for the system library, you may want to see
> them.
>
> So. We should be using C_INCLUDE_PATH instead of CPATH, to mark system
> headers as system headers. Except that C_INCLUDE_PATH only works for C,
> so we need to also set CPLUS_INCLUDE_PATH and OBJC_INCLUDE_PATH. And
> that's the proposal of this bug :)
>
> Andy
>
Are there other ones that could be set? Every time I compile it I see options
for java and go.
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-12-16 20:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 14:41 bug#22186: Use {C,CPLUS,OBJC}_INCLUDE_PATH instead of CPATH Andy Wingo
2015-12-16 20:18 ` Efraim Flashner [this message]
2015-12-17 9:20 ` Andy Wingo
2015-12-17 10:43 ` Ludovic Courtès
2015-12-17 21:43 ` Ludovic Courtès
2015-12-18 9:05 ` Andy Wingo
2015-12-18 14:09 ` Ludovic Courtès
2015-12-18 23:04 ` Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151216221837.588bacf3@debian-netbook \
--to=efraim@flashner.co.il \
--cc=22186@debbugs.gnu.org \
--cc=wingo@igalia.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).