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, 07 Apr 2017 11:11:32 -0700 Organization: None to speak of Lines: 66 Message-ID: References: <4BOCA.259404$IM7.111342@fx39.iad> <2R7DA.679006$vF2.481444@fx46.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="83f666fd2f38cdf8d463ddb651b61d5d"; logging-data="18700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18d26RkJGV5LeuN9+wIHk5l" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:wVl8AMThUZWTl0qCoyjqX/dohBc= sha1:ulbZWTK2dsPWt+noBIpop79b1CU= Xref: csiph.com comp.lang.c:107830 bartc writes: > On 03/04/2017 15:47, David Brown wrote: >> On 03/04/17 15:40, bartc wrote: > [About clang on Windows] > >>> (1) By itself, it can't compile Hello World. Because it piggybacks onto >>> another compiler. (I think this used to be gcc, and now it might be >>> MSVC. The fact is I couldn't get a recent download working) >> >> It is a compiler, not a full C implementation. > > What does a compiler do, and what should be its output? > >> A C compiler does not >> have a library or a assembler or a linker. > > Does it have a set of standard include files? If not, where do they come > from? Wikipedia tells me clang is a front-end to LLVM. So, does LLVM > provided the includes files? If not, where are they? In a clang installation, LLVM is part of the compiler. As I understand it, the clang/LLVM distinction is about the internal organization of the compiler itself. It has nothing to do with headers or the library. (I don't entirely understand the organization myself.) If you want a description of what LLVM is, Google it; the first paragraph of the Wikipedia article has what I presume to be a decent summary. [...] > If I reduce the program to just: > > extern int printf(char*,...); > > int main(void) { > printf("Hello World!\n"); > } > > it complains about a incompatible declaration of printf warning. Declaring printf correctly might have helped -- and clang's warning tells you what the problem is ("char*" should be "const char*"). Actually it should be extern int printf(const char * restrict, ...); but clang doesn't seem to complain if the "restrict" is missing. [...] > It's even easier to just install those and use them; why bother with > clang at all? And where would we all be if the developers of MSVC, mingw > and other compilers took the same approach, requiring people to download > another compiler to provide the missing bits?! Your complaint is about the difficulty of installing clang on Windows. This is not a C language issue; it's a software packaging issue. I suggest you go the web site where you downloaded clang, look for a contact link, and describe your problem to them. Perhaps they can help. -- 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"