Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #162807

Re: How to print gcc include path using C?

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c
Subject Re: How to print gcc include path using C?
Date 2021-09-21 14:07 -0700
Organization None to speak of
Message-ID <874kadocy1.fsf@nosuchdomain.example.com> (permalink)
References (5 earlier) <8c9ee357-2795-43ed-839c-ae7341912d6an@googlegroups.com> <sicp12$4ia$1@z-news.wcss.wroc.pl> <b83285a3-66df-438a-a949-f9c3c8acafdfn@googlegroups.com> <n5r2J.115515$rl3.104681@fx45.iad> <87czp1oebm.fsf@nosuchdomain.example.com>

Show all headers | View raw


Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> scott@slp53.sl.home (Scott Lurndal) writes:
>> Thiago Adams <thiago.adams@gmail.com> writes:
>>>On Tuesday, September 21, 2021 at 11:08:41 AM UTC-3, anti...@math.uni.wroc.pl wrote:
>>>
>>>> In case you missed it: 7 in '/usr/lib/gcc/x86_64-linux-gnu/7/include' 
>>>> is version number, so will be different for different gcc versions. 
>>>> 'x86_64-linux-gnu' is platform name, on different platform like 
>>>> ARM it will be different. 
>>>
>>>How can I find out what is the default gcc? (sorry I am a windows
>>>developer,  generally this kind of information is on Windows registry  
>>>but I have no idea where to find this on Linux - This is a little of topic
>>>but it also interesting for C developers to know where the compiler gets
>>>its headers from)
>>
>> There is no "default" GCC.  Every linux distribution is free to ship
>> whatever version of GCC they desire.   RHEL6/7, for example, still
>> ship GCC4, while the latest Ubuntu may have GCC10 or GCC11; and
>> a LTS release of Ubuntu  may have an earlier version.
>
> A user or administrator can install any version of gcc they like, in any
> location they like.  The concept of "default" isn't really well defined.
> The closest you can get is that the "default" for a given system is
> probably /usr/bin/gcc, or at least the gcc that's in the user's default
> $PATH (not all distributions necessarily distinguish between /usr/bin
> and /bin).
>
> If there's a /usr/local/bin/gcc that differs from /usr/bin/gcc, it's not
> clear which of them is the "default".  Probably /usr/bin/gcc is the
> default for the distribution and /usr/local/bin/gcc is the default for
> that particular machine, or perhaps a collection of machines that are
> administered together.

You also need to consider that the "cc" and "c99" commands may or may
not invoke gcc -- and if I recall correctly the "gcc" command on MacOS
typically invokes clang (the name "gcc" is used because a lot of build
scripts assume that gcc is present, and clang is usually close enough).

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to print gcc include path using C? Thiago Adams <thiago.adams@gmail.com> - 2021-09-20 11:48 -0700
  Re: How to print gcc include path using C? Bart <bc@freeuk.com> - 2021-09-20 20:45 +0100
    Re: How to print gcc include path using C? Thiago Adams <thiago.adams@gmail.com> - 2021-09-20 12:55 -0700
      Re: How to print gcc include path using C? scott@slp53.sl.home (Scott Lurndal) - 2021-09-20 21:53 +0000
        Re: How to print gcc include path using C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-20 17:54 -0700
          Re: How to print gcc include path using C? Thiago Adams <thiago.adams@gmail.com> - 2021-09-21 05:07 -0700
            Re: How to print gcc include path using C? scott@slp53.sl.home (Scott Lurndal) - 2021-09-21 14:00 +0000
            Re: How to print gcc include path using C? Mark Bluemel <mark.bluemel@gmail.com> - 2021-09-21 07:07 -0700
            Re: How to print gcc include path using C? antispam@math.uni.wroc.pl - 2021-09-21 14:08 +0000
              Re: How to print gcc include path using C? Thiago Adams <thiago.adams@gmail.com> - 2021-09-21 12:01 -0700
                Re: How to print gcc include path using C? gazelle@shell.xmission.com (Kenny McCormack) - 2021-09-21 20:13 +0000
                Re: How to print gcc include path using C? scott@slp53.sl.home (Scott Lurndal) - 2021-09-21 20:17 +0000
                Re: How to print gcc include path using C? gazelle@shell.xmission.com (Kenny McCormack) - 2021-09-21 20:35 +0000
                Re: How to print gcc include path using C? scott@slp53.sl.home (Scott Lurndal) - 2021-09-21 21:30 +0000
                Re: How to print gcc include path using C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-21 13:37 -0700
                Re: How to print gcc include path using C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-21 14:07 -0700
                Re: How to print gcc include path using C? antispam@math.uni.wroc.pl - 2021-09-21 23:05 +0000

csiph-web