Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Even more problems with lcc-win Date: Fri, 24 Mar 2017 13:48:20 -0700 Organization: None to speak of Lines: 47 Message-ID: References: <87vaqyvqzb.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="942005ccab53837d4f31c6c0d31e9033"; logging-data="26956"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/h3NH8WDq6uX+qR4SAoYE/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:nte4cfhExu78bEKMUI4LlKqrfdI= sha1:aybT8GRrEjvQSZenjQwVpn3W8cU= Xref: csiph.com comp.lang.c:107000 BartC writes: [...] > stdio.h exists in /usr/include/. There is also a version in > /usr/include/x64_64-linux-gnu/bits/ It's /usr/include/x86_64-linux-gnu/bits/, not /usr/include/x64_64-linux-gnu/bits/ But that second one is just another file that happens to have the same name. On my system, it includes the following lines: #ifndef _STDIO_H # error "Never include directly; use instead." #endif It's an *internal* file, part of the implementation, not something that any C programmer needs to care about. It doesn't provide, for example, a declaration of printf, just some low-level declarations that are used by the real . Apparently the designers found it useful to use parallel file names (that directory contains several other files whose names match those of standard headers). > So the OS is providing stdio.h, and gcc tells me that is the one it uses > (the bits directory isn't directly specified in the include search path). Actually it's provided by the libc6-dev package, at least on my Ubuntu system -- but I think that package is preinstalled, so you could say it's provided by the OS. [...] > Anyway I'm not sure why this is relevant: does the definition of > printf() differ wildly across OSes? (I'm sure you mean the *declaration* of printf.) It doesn't vary a whole lot, though some systems will probably have to make the "restrict" optional somehow to allow for pre-C99 compilers. But the definition of type FILE probably does vary a great deal. [...] -- 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"