[cfe-dev] Help with decrypting extra output and suggestion for a guide

Sebastian Redl sebastian.redl at getdesigned.at
Thu Nov 25 01:34:10 PST 2010


On 25.11.2010 10:07, David Gilmore wrote:
> Yet this book does not has the intermediate to advanced knowledge that 
> I am needing or wanting.  I have also been reading the GCC 
> documentation but it seems too be a more formal explanation of the 
> compiler and tools. Not that many examples and good explanations of 
> why or when to use some argument or option. For example they use -Wall 
> argument to set a whole list of other arguments for warnings, but from 
> my experiments your compiler (clang) does not. Is this true or am I 
> wrong?
-Wall enables most warnings in Clang, just as it does in GCC.

> Preprocessing:
> Extra output shown what does it mean?
These are GCC-style shorthand line directives. They are used so that 
error messages from a preprocessed file still point to the correct files 
and lines in the original file. For example,
#1 "tfile.c"
means "line 1 of tfile.c starts here".

> Output after bad commandline argument!!!!
> clang -fsyntax tfile.c
Strange, that should at least warn that the argument is unused.

> Type checking
> No Output for both commands is this right?
Yes. If there is nothing wrong with the files, -fsyntax-only doesn't 
output anything.

> Code generation with llvm:
> Lots of extra output. What did it means and were can I find the information about it?
That's LLVM IR in text form.
http://llvm.org/docs/LangRef.html

> More extra output, same again. Is this a elf file format or assembly sections with extra parts. Where can I get info?
That's x86 assembly in AT&T syntax, as *nix linkers accept it.

Summary: How much do you know about the process of compiling in general? 
Maybe you should get a book on compilers if you're interested in that 
topic. And I don't mean an internals/usage book for a specific compiler, 
I mean a general book on compilers such as this one:
http://www.amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/0201100886

Sebastian



More information about the cfe-dev mailing list