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


Groups > comp.lang.c > #120677

Re: style question - includes

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: style question - includes
Date 2017-10-01 19:28 -0700
Organization None to speak of
Message-ID <lnfub2s2p8.fsf@kst-u.example.com> (permalink)
References <9a15228d-c10f-4ca4-b1cc-ce4bac0cad57@googlegroups.com> <53b3579e-0720-48fc-8869-fde0c55f169a@googlegroups.com> <7e264fae-2cac-449a-a453-432302ea79ce@googlegroups.com> <lnvajzstja.fsf@kst-u.example.com> <95591c55-890b-496e-8f94-5f5241516849@googlegroups.com>

Show all headers | View raw


supercat@casperkitty.com writes:
> On Saturday, September 30, 2017 at 5:36:49 PM UTC-5, Keith Thompson wrote:
>> Right.  N1570 6.10.2 says that #include <...> searches for a *header*,
>> while #include "..." searches for a *source file* (and falls back to the
>> <...> search).  I don't think the standard defines what a "header" is,
>> which means it can be anything that acts like an includable source file.
>
> As a further note, inclusion of headers is only allowed in certain contexts,
> while source files may be included in many other contexts.

There are restriction on where the language-defined standard headers can
meaningfully be included.  I don't think there's any such restriction on
where other headers can be included (though particular headers might
impose their own restrictions0.

[...]

>      It could also simply produce a "Headers may not be included in this
> context" diagnostic whether or not there would be any way to write a file
> that would be able to detect the context where it was included.

Have you seen such a diagnostic?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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


Thread

Re: style question - includes jameskuyper@verizon.net - 2017-09-30 12:25 -0700
  Re: style question - includes Thiago Adams <thiago.adams@gmail.com> - 2017-09-30 13:40 -0700
  Re: style question - includes supercat@casperkitty.com - 2017-09-30 14:04 -0700
    Re: style question - includes Keith Thompson <kst-u@mib.org> - 2017-09-30 15:36 -0700
      Re: style question - includes supercat@casperkitty.com - 2017-10-01 16:07 -0700
        Re: style question - includes Keith Thompson <kst-u@mib.org> - 2017-10-01 19:28 -0700
          Re: style question - includes supercat@casperkitty.com - 2017-10-02 12:25 -0700
            Re: style question - includes Keith Thompson <kst-u@mib.org> - 2017-10-02 12:49 -0700
              Re: style question - includes "James R. Kuyper" <jameskuyper@verizon.net> - 2017-10-02 16:11 -0400

csiph-web