Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: printf format specifier changes |
| Date | 2015-09-08 12:24 -0700 |
| Organization | None to speak of |
| Message-ID | <lnzj0wr9x9.fsf@kst-u.example.com> (permalink) |
| References | (10 earlier) <msmg00$9ob$1@dont-email.me> <cjutua1ginntcb0j3pis2an2s2t9r637f5@4ax.com> <msn142$esu$1@dont-email.me> <lnd1xssus6.fsf@kst-u.example.com> <msn89l$f9k$1@dont-email.me> |
Bartc <bc@freeuk.com> writes:
> On 08/09/2015 18:08, Keith Thompson wrote:
>> Bartc <bc@freeuk.com> writes:
>>> On 08/09/2015 16:13, Robert Wessel wrote:
>>>> On Tue, 8 Sep 2015 12:17:01 +0100, Bartc <bc@freeuk.com> wrote:
>>>
>>> [clang]
>>>>> (** It turns out that clang has been piggy-backing onto top of whatever
>>>>> gcc has been installed. It uses the include files and library files of
>>>>> gcc; possibly even its linker. By itself, it can't even compile Hello
>>>>> World, and that's a 400MB installation!)
>>>>
>>>> You do know that GCC doesn't have any of that stuff either
>>>
>>> Actually, no I didn't.
>>
>> Really? It's been mentioned here numerous times; how did you not know
>> that?
>
> No, what's been mentioned a few times, when talking about how some
> library function works, is that gcc and the library are separate, and
> the responsibility is with different groups.
Yes. Isn't that pretty much what I said?
> Not that gcc normally comes with no include files (not even stdio.h) nor
> any libraries. A library is not necessarily an actual library, but it
> can be just the means to link a application with the library proper (a
> set of declarations for a DLL file for example). But not even those.
gcc is a compiler. It's not a complete C implementation, it's one
component of a complete C implementation.
stdio.h (whether it's a C header file or something else) is also
part of a C implementation but not part of the compiler.
Installing a C implementation requires installing the compiler,
the header, the runtime library, the linker, and whatever other
components are required to make up a working implementation.
Sometimes all those components are provided as a single convenient
installation.
The dividing line between the various "components" that make up a
C implementation varies. Typically the header file stdio.h and the
library that contains the code for printf and friends are part of the
same component, but in principle they could be provided separately.
The preprocessor is usually provided by, or even integrated into,
the compiler, but again that's an arbitrary implementation detail.
lcc-win, to take one example, as I understand it, is a complete
implementation (as far as I know), but I presume that, at least in
principle, you could use a different compiler to generate code that
could use the lcc-win library.
> I'm quite interested now in how many C compilers, even substantial ones
> such as clang, cannot even be used to compile a Hello-World program
> because the basic essentials are missing.
A C compiler *by itself* typically cannot compile a hello-world
program, because if all you have is C compiler, you don't have a
complete implementation.
In principle a compiler could incorporate the standard headers
(which don't have to be physical source files), and could generate
code that doesn't depend on any library. As far as I know this is
not typically done.
> (In the case of clang, a simple Readme of what it is, what it does, what
> is included, what isn't included, and what is needed to start compiling
> C programs into executables, would not have gone amiss. I expect with a
> 438MB distribution they couldn't squeeze in a 1K text file!)
Actually it's 1257 bytes.
A Google search for "clang" led me to
http://llvm.org/releases/download.html
which includes a link to
http://llvm.org/releases/3.7.0/cfe-3.7.0.src.tar.xz
labeled "Clang source code".
Unpacking that (I presume there's a way of doing that on Windows),
I see that it includes a file at the top level called "README.txt"
which starts with:
//===------------------------------------------------------------===//
// C Language Family Front-end
//===------------------------------------------------------------===//
Welcome to Clang. This is a compiler front-end for the C family of
languages (C, C++, Objective-C, and Objective-C++) which is built as
part of the LLVM compiler infrastructure project.
(I've slightly reformatted the text).
Of course this requires understanding what a "compiler front-end" is.
If you expect a "compiler front-end" to include stdio.h, perhaps
you need something more extensive than a README.txt file to exlain
it to you.
Incidentally, the src.tar.xz file is 8.8MB, and unpacks to a 98M
directory tree. There's also a "Clang for Windows (64-bit)" .exe
installer that's 49.5MB. I don't know what you're referring to
that's 438MB.
>> MinGW is a C implementation that includes the gcc compiler and the
>> Microsoft runtime library.
>
> clang can't get that far: "hello.c:1:10: fatal error: 'stdio.h' file not
> found". I can't point it to where the stdio.h is, because it doesn't
> exist. I used to think it was because such headers were built-in, but
> when it's worked in the past, it might be because it searched my file
> system for a gcc installation and quietly made use of gcc's files.
>
> But some good news at least: anything who's thinking of writing a C
> compiler (there seem to be a few at the minute), apparently only has to
> produce a bare compiler. Forget standard headers, libraries, linkers or
> anything else. No need to actually make it do anything useful!
Right, if those other components already exist you don't need to
provide them. If you want to write a complete C implementation,
that includes the compiler, the library, the linker, and so forth.
I get the impression that you think you're making some meaningful
point. As far as I can tell, this whole discussion is about the
meaning of the word "compiler", and perhaps some confusion between a
"compiler" and an "implementation".
Some of this probably sounds a bit sarcastic. That's not my intent.
I get the impression that you're having trouble understanding some
very basic points that have been explained repeatedly. I don't
think that's actually what's going on, but I'm not sure what is.
I do understand that you're frustrated by the difficulty of
installing certain software packages on Windows.
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-06 09:04 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-06 17:50 +0100
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-06 11:34 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-06 19:47 +0100
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-06 19:53 +0100
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-06 11:57 -0700
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-06 10:53 +0100
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-06 04:21 -0700
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 10:40 +0100
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-07 03:07 -0700
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 15:09 +0100
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-07 12:03 +0100
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-07 12:46 +0100
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 15:24 +0100
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 15:16 +0100
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-07 17:09 +0100
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 17:47 +0100
Re: printf format specifier changes Richard Damon <Richard@Damon-Family.org> - 2015-09-07 13:29 -0400
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 12:17 +0100
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-08 10:13 -0500
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 17:09 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-08 10:08 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 19:11 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-08 12:24 -0700
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-08 14:56 -0500
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 22:18 +0100
Re: printf format specifier changes Ian Collins <ian-news@hotmail.com> - 2015-09-09 09:29 +1200
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 22:58 +0100
Re: printf format specifier changes Ian Collins <ian-news@hotmail.com> - 2015-09-09 10:32 +1200
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-08 15:57 -0700
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-08 15:12 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-08 23:45 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-08 16:36 -0700
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-08 19:17 -0500
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-09 09:56 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-09 11:33 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-09-09 20:35 +0100
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-08 14:51 -0500
Re: printf format specifier changes David Brown <david.brown@hesbynett.no> - 2015-09-08 22:41 +0200
Re: printf format specifier changes Richard Damon <Richard@Damon-Family.org> - 2015-09-07 12:03 -0400
Re: printf format specifier changes glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-10 06:33 +0000
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-10 02:38 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-10 07:01 -0700
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-10 12:47 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-10 14:08 -0700
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-10 15:17 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-10 16:02 -0700
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-10 17:31 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-11 15:43 -0700
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-09-11 16:23 -0700
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-11 23:33 -0500
Re: printf format specifier changes Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-11 21:44 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-12 09:02 -0700
Re: printf format specifier changes Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-26 15:00 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-27 11:21 -0700
Re: printf format specifier changes Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-29 10:10 -0700
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-06 13:41 +0100
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:23 -0500
Re: printf format specifier changes "James Harris" <james.harris.1@gmail.com> - 2015-09-07 11:31 +0100
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-07 03:54 -0700
Re: printf format specifier changes Richard Heathfield <rjh@cpax.org.uk> - 2015-07-06 19:44 +0100
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-06 22:14 +0100
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-07-06 22:43 -0500
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-06 23:01 -0700
Re: printf format specifier changes glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-07 06:43 +0000
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-09 10:52 +0300
Re: printf format specifier changes Richard Heathfield <rjh@cpax.org.uk> - 2015-07-09 09:26 +0100
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-12 12:56 +0300
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-12 06:12 -0700
Re: printf format specifier changes Rosario19 <Ros@invalid.invalid> - 2015-07-07 10:22 +0200
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-07 10:10 +0100
Re: printf format specifier changes Philip Lantz <prl@canterey.us> - 2015-07-07 00:54 -0700
Re: printf format specifier changes Nobody <nobody@nowhere.invalid> - 2015-07-07 15:08 +0100
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-07 16:12 +0100
Re: printf format specifier changes raltbos@xs4all.nl (Richard Bos) - 2015-07-09 10:34 +0000
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-09 12:25 +0100
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-12 13:02 +0300
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-12 11:23 +0100
Re: printf format specifier changes <william@wilbur.25thandClement.com> - 2015-07-07 11:50 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-07 12:14 -0700
Re: printf format specifier changes Les Cargill <lcargill99@comcast.com> - 2015-07-07 21:52 -0500
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-07 20:42 -0700
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-09 11:12 +0300
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-09 05:03 -0700
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-09 13:10 -0500
Re: printf format specifier changes James Kuyper <jameskuyper@verizon.net> - 2015-07-09 08:58 -0400
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-09 08:10 -0700
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-12 12:58 +0300
Re: printf format specifier changes James Kuyper <jameskuyper@verizon.net> - 2015-07-12 12:57 -0400
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-12 11:14 -0700
Re: printf format specifier changes gazelle@shell.xmission.com (Kenny McCormack) - 2015-07-12 18:26 +0000
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-08 13:09 +0100
Re: printf format specifier changes James Kuyper <jameskuyper@verizon.net> - 2015-07-08 08:10 -0400
Re: printf format specifier changes Les Cargill <lcargill99@comcast.com> - 2015-07-08 08:12 -0500
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-08 08:38 -0700
Re: printf format specifier changes James Kuyper <jameskuyper@verizon.net> - 2015-07-08 12:00 -0400
Re: printf format specifier changes Les Cargill <lcargill99@comcast.com> - 2015-07-08 17:20 -0500
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-09 11:08 +0300
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-08 20:30 +0300
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-08 18:56 +0100
Re: printf format specifier changes gordonb.lmwiv@burditt.org (Gordon Burditt) - 2015-07-09 11:09 -0500
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-09 14:05 -0500
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-08 11:27 -0700
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-08 15:07 -0500
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-06 23:39 -0500
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-07 10:19 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-07 07:57 -0500
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-07 14:15 +0100
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-07 14:46 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-07 09:37 -0500
Re: printf format specifier changes Phil Carmody <pc+usenet@asdf.org> - 2015-07-09 11:24 +0300
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-09 09:55 -0500
Re: printf format specifier changes <william@wilbur.25thandClement.com> - 2015-07-09 11:53 -0700
Re: printf format specifier changes <william@wilbur.25thandClement.com> - 2015-07-09 13:48 -0700
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-09 17:01 -0500
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-07 10:59 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-07 07:48 -0500
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-07 14:30 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-07 10:05 -0500
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-07 23:16 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-07 20:29 -0500
Re: printf format specifier changes Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-08 00:43 -0700
Re: printf format specifier changes Robert Wessel <robertwessel2@yahoo.com> - 2015-07-09 02:29 -0500
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-09 10:34 +0100
Re: printf format specifier changes BGB <cr88192@hotmail.com> - 2015-07-09 09:35 -0500
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-07 08:37 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-07 08:45 -0700
Re: printf format specifier changes supercat@casperkitty.com - 2015-09-07 08:29 -0700
Re: printf format specifier changes <william@wilbur.25thandClement.com> - 2015-07-07 12:12 -0700
Re: printf format specifier changes pooja deshpande <namitadeshpande25@gmail.com> - 2015-07-09 09:29 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 09:34 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 09:59 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-09 22:33 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-09 15:17 -0700
Re: printf format specifier changes glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-10 00:30 +0000
Re: printf format specifier changes Reinhardt Behm <rbehm@hushmail.com> - 2015-07-10 09:17 +0800
Re: printf format specifier changes David Kleinecke <dkleinecke@gmail.com> - 2015-07-09 10:02 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 10:19 -0700
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-09 21:50 +0100
Re: printf format specifier changes Keith Thompson <kst-u@mib.org> - 2015-07-09 15:05 -0700
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 15:09 -0700
Re: printf format specifier changes Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-10 00:28 +0100
Re: printf format specifier changes raltbos@xs4all.nl (Richard Bos) - 2015-07-13 20:39 +0000
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 15:07 -0700
Re: printf format specifier changes Bartc <bc@freeuk.com> - 2015-07-09 23:16 +0100
Re: printf format specifier changes "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-09 15:25 -0700
csiph-web