Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: style question - includes Date: Sun, 01 Oct 2017 19:28:35 -0700 Organization: None to speak of Lines: 28 Message-ID: References: <9a15228d-c10f-4ca4-b1cc-ce4bac0cad57@googlegroups.com> <53b3579e-0720-48fc-8869-fde0c55f169a@googlegroups.com> <7e264fae-2cac-449a-a453-432302ea79ce@googlegroups.com> <95591c55-890b-496e-8f94-5f5241516849@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="6cf03bc409832187b50b684a697bfd95"; logging-data="24697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ufsD2a3a8RlWXWSZgOQrN" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:PjX0SqBxFgoFM2iIvc01kKxXNTw= sha1:6wv/r72wZiRTXzUnxHVYXdQs9DA= Xref: csiph.com comp.lang.c:120677 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 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"