I'm wondering about the difference between what is defined by the several standards of the C language and the things that every compilers implements in a different way from the others, i want to really understand what the official specs of the C language are: there are some official docs?
I'm looking for technical stuff, not a thread on the internet, some good pdfs maybe; something that can describe everything happens with the memory management, the allocation, the lenght and the encoding of the variables, etc etc ...
I have the official manual from K&R but it's not really about what i am interested to, it's more on the "programmer side" i want something more technical and affermative.
PS
the C language have an official website for reference?
Check this
"Obtaining the Standard
Neither the Standard nor its amendments are available free of charge, although its drafts, rationales, technical corrigenda (TCs) and defect report responses are.
The Standard can be purchased in hardcopy and/or downloadable digital format from national affiliates as described on the WG14 website. Two such national bodies are ANSI - through its eStandards Store - and SAI Global (originally Standards Australia) which sells all of the ISO C Standard publications. One international source is Techstreet.
Listed below are direct links to pages for purchase or free download of the Standard, its TCs, amendments, drafts, rationales and defect report responses for each version of the Standard. The set of documents is comprehensive whereas the list of sources obviously is not."
Tried to add this as a comment but the URL would not take.
Try: http://www.deitel.com/Default.aspx?tabid=204 for details on C. I also suggest you dig up GNU's big document on C as they do some things differently and it can be important to understand GNUs way of doing things. http://gcc.gnu.org/onlinedocs/.
Related
I've been reading up a lot on how C works, and I think I have an idea for how to make it better. From what I've read it seems like the standard changes from time to time, and I was wondering if there is a place I could go to submit a new idea for the next revision.
The committee's web site is http://www.open-std.org/JTC1/SC22/WG14/.
Their contact info is at http://www.open-std.org/JTC1/SC22/WG14/www/contacts.
The most recent C standard was released late last year; a draft that should be almost identical to the released standard, is N1570, or you can buy the official standard from the ANSI store, or from your national standards body.
Ideas are often discussed on the comp.std.c Usenet newsgroup; it's a good place to get feedback, but it has no official association with the committee.
Your idea will have a much better chance of being adopted if you can demonstrate existing practice, i.e., and existing C compiler that already implements it as an extension -- and if it doesn't violate the vaguely defined "spirit of C".
I am learning c programming in Linux. There are a lot of linux functions I need to look at. Is there a website that gives me the details of the Linux functions?
Are you referring to system calls in Linux? There are lots of sources. The man pages are your good friends in this regard. Try also http://linux.die.net/man/2/syscalls. I am sure there are lots of others.
The standard reference by far is "Advanced programming in the UNIX environment" by Richard Stevens. Unfortunately this book is quite old, so there is a revised edition by Eric Raymond, which covers new stuff in Linux. This -- more than anything else -- is the de facto standard for learning "old world" systems programming in Linux. (And most other *ixes, there are of course differences, but you won't notice them until you're much more advanced, and by that point you'll be familiar with the man pages and know where to look.)
You can look at the LSB (Linux Standard Base) website:
http://www.linuxfoundation.org/collaborate/workgroups/lsb
Here are is the last Linux Standard Base Core Specification:
http://refspecs.linuxfoundation.org/lsb.shtml
IMHO http://linux.die.net/man/ is the easiest to get to start with.
It has useful sections introductions, so you can get your bearings
Most usefully are the one line synopsis pages, e.g. http://linux.die.net/man/3/
This shows the scale of what you are asking, and also lets you search for a key word describing each function within your browser, which can be very handy.
As has been pointed out, it is not the most up-to-date, but IMHO it is easier for a beginner to use than the alternative I've seen (not that there can't be something better, just google doesn't bother to show it).
Also worth trying apropos or man 3 -K or aman -k`
I find the glibc manual very good. It is organized by topic and contains concise background material and examples. It'll allow you to get the big picture and serves as a reference. Manpages are a quicker way to access function descriptions but there are only useful if you already know what you are looking for.
I found (in http://c-faq.com/ansi/avail.html) that "An electronic (PDF) copy is available on-line, for US$18, from www.ansi.org".
But at the same time, I can download it for free from http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf
Both are C standards, right ? What is the difference between two ?
The latter is a draft. Accurate and containing everything you need, but in draft form.
This is a WG14 working paper, but it reflects the consolidated
standard at the time of issue
All the documents like n1234 are draft versions of the standards. If you want the real, published versions, you have to buy them from your local standards organisation.
That's rarely necessary unless you're Microsoft, Borland/Unprized/Enchilada (or whatever they call themselves nowadays), IBM or some other compiler writer. Normal people get by quite adequately on the late-edition drafts just fine.
The latest draft, dubbed C1X, and approved for publication, is http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1548.pdf. This is probably as close to the next standard as you will be able to get without paying for the formalized version.
Better to take that version, since n1256 missed several clarifications and corrections.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm looking for the documentation of all the syntax and built-in functions in C, but I can't find any site online which seems like an ultimate official source of standard C knowledge.
Apart from the famous book by Kernighan and Ritchie, isn't there any online C specification? Maybe there is, and I don't know how to find it. Or maybe the problem is that I don't exactly know what I'm looking for.
You can obtain a PDF copy of the C99 standard (ISO/IEC 9899:1999) from ANSI (and other fine standards organizations) for your private use for a modest fee - I believe it was 18 USD when I bought mine. Having that available is invaluable to me. But if you find a copy in public, then it is contraband.
You can find final committee drafts and current working documents of the C (C0x) Standard Committee at the JTC1, SC22, WG14 web site at the Open Standards Organization. (That's Joint Technical Committee 1, Sub-Committee 22, Working Group 14, I believe).
There is also a hardback book 'The C Standard: Incorporating Technical Corrigendum 1' (also including the Rationale) available for a slightly less modest 85 USD or thereabouts.
One of the best books about C is 'C: A Reference Manual' in its fifth edition. However, you asked for 'ultimate official source of standard C knowledge', and the only 'official' such source is the C standard, plus its corrigenda.
See also the material at http://www.coding-guidelines.com/ and http://c0x.coding-guidelines.com/.
There is this online website devdocs
They have multiple API documentations which are well organized. It is free and open-source.
For c doc click this link http://devdocs.io/c/
The official C99 standard is available for purchase from your national standards body; however, in practice everyone reads the draft with post-1999 corrections/amendments included, which you can download for free:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
Strictly speaking, the C standard is not available for free. You need to purchase an electronic copy from http://www.ansi.org/ or http://www.iso.org.
However, you can download a free draft version from the Open Standards Organization's website - this is as good as or better than the official standard itself. It incorporates information from the ISO C99 standard plus three Technical Corrigenda, all of which are official ISO documents.
More info here: http://c-faq.com/ansi/avail.html
Is there something like the official C documentation?
The most official documentation is the ISO standard, to which compilers are written and are expected to interpret correctly.
C99 Standard
Here's the latest Committee draft on the C99 Standard, last updated April 12, 2011:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
I'll try to keep it up to date with the latest version as I can.
Kernighan & Ritchie
I also found K&R's text, second edition, here: http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf
However, I'd use the -Wall flag when compiling the examples in the book so that you don't get led too far astray by the age of the text.
C is an ISO standardised language. Current specification is ISO/IEC 9899:1999 standard a.k.a. C99.
You can refer GNU C documentation at https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html
Specifically, this manual aims to document:
The 1989 ANSI C standard, commonly known as “C89”
The 1999 ISO C standard, commonly known as “C99”, to the extent that C99 is implemented by GCC
The current state of GNU extensions to standard C
There're various C standard specifications.
See C's history on wikipedia for example.
When we talk about standard C these days, we mostly refer to the ANSI C Standard.
Here's a link to the standard in textform:
http://flash-gordon.me.uk/ansi.c.txt
Look at The New C Standard: An Economic and Cultural Commentary.
If what you want is the documentation for the standard library functions, then P.J. Plauger's "The Standard C Library" http://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099/ref=sr_1_1?s=books&ie=UTF8&qid=1290273108&sr=1-1 is the best reference. It's got pretty extensive annotation and comentary on the why and how of the standard.
https://msdn.microsoft.com/en-us/library/fw5abdx6.aspx
The "C Language Reference" describes the C programming language as implemented in Microsoft C. The book's organization is based on the ANSI C standard with additional material on the Microsoft extensions to the ANSI C standard.
Is there a new upcoming C Standard that supersedes C99? After all there's an unofficial C++0x coming out as per the source in Wikipedia here. For the sake of this question, let's call this C99 superset as C'y2k.01' to not confuse (as I was going to say C99++ which looks like the C++ counterpart.... but I digress)
If there isn't, what would you like to see in the C'y2k.01' standard today in order for the C language to survive in the 21st century? Sure there's Java, .NET, C#, Scala, Erlang, F# to name but a few, but really, go on...
I would like to see:
Unifying the Posix functions into the runtime,
with the #1 mentioned above, fork()ing would be much easier and parallelizing the code would be made possible instead of relying on a third party library
The ease of dynamic memory for custom collections such as arrays ... something like this 'char __dynamic foo[];' where you can add/remove elements easily
This is open to debate and discussion.
Thanks.
There is a project in place to update C99. The draft is currently dubbed C1X and is available here. You can also see the charter.
You can see a list of the currently open projects and get up to date news from the ISO C Working Group.