нужен стандарт ANSI C.
11.2: How can I get a copy of the Standard?
A: Copies are available in the United States from
American National Standards Institute
11 W. 42nd St., 13th floor
New York, NY 10036 USA
(+1) 212 642 4900
and
Global Engineering Documents
15 Inverness Way E
Englewood, CO 80112 USA
(+1) 303 397 2715
(800) 854 7179 (U.S. & Canada)
In other countries, contact the appropriate national standards
body, or ISO in Geneva at:
ISO Sales
Case Postale 56
CH-1211 Geneve 20
Switzerland
(or see URL http://www.iso.ch or check the comp.std.internat FAQ
list, Standards.Faq).
At the time of this writing, the cost is $130.00 from ANSI or
$400.50 from Global. Copies of the original X3.159 (including
the Rationale) may still be available at $205.00 from ANSI or
$162.50 from Global. Note that ANSI derives revenues to support
its operations from the sale of printed standards, so electronic
copies are *not* available.
In the U.S., it may be possible to get a copy of the original
ANSI X3.159 (including the Rationale) as "FIPS PUB 160" from
National Technical Information Service (NTIS)
U.S. Department of Commerce
Springfield, VA 22161
703 487 4650
The mistitled _Annotated ANSI C Standard_, with annotations by
Herbert Schildt, contains most of the text of ISO 9899; it is
published by Osborne/McGraw-Hill, ISBN 0-07-881952-0, and sells
in the U.S. for approximately $40. It has been suggested that
the price differential between this work and the official
standard reflects the value of the annotations: they are plagued
by numerous errors and omissions, and a few pages of the
Standard itself are missing. Many people on the net recommend
ignoring the annotations entirely. A review of the annotations
("annotated annotations") by Clive Feather can be found on the
web at http://www.lysator.liu.se/c/schildt.html .
The text of the Rationale (not the full Standard) can be
obtained by anonymous ftp from ftp.uu.net (see question 18.16)
in directory doc/standards/ansi/X3.159-1989, and is also
available on the web at
http://www.lysator.liu.se/c/rat/title.html . The Rationale has
also been printed by Silicon Press, ISBN 0-929306-07-4.
See also question 11.2a below.
11.2a: Where can I get information about updates to the Standard?
A: You can find some information at the web sites
http://www.lysator.liu.se/c/index.html and http:/www.dmk.com.
это стандарт С99, а нужен ANSI 1989 года
А зачем старый стандарт?
Задача такая: есть транслятор со специализированного языка в С99, который потом компилируется gcc. Теперь надо пересадить эту цепочку с gcc на старый, но испытанный компилятор ANSI C 89.
Нужно подкрутить транслятор, чтобы он корректно генерировал код ANSI C 89. Для этого надо знать много мелкой и нудной бадяги вроде способа упаковки структур, обработки битовых полей и побитовых операций, сочетаний знакового и беззнакового и т.п.
а также помудохаться с прототипами функций
Основное, на что придется посмотреть, это инициализация сложных типов, и проследить за тем, чтобы определения всех переменных были в начале блока. В остальном, за исключением фенечек, не должно быть никаких проблем. Можно пинать выход Вашего транслятора через gcc вместе с -std=c89 -pedantic.
И еще можно посмотреть на исходники gcc, в новом С парсере (c-parser.c) явно отмечены места, которые не являются С89. (NB: в этом случае лучше взять один из последних снапшотов, нового парсера еще не было в gcc 4.0)
Оставить комментарий
sevast82
Есть ли у кого-нибудь описание стандарта ANSI C образца 88-89 года (точно не помню, когда его родили)?Официальный документ не обязателен (хотя желателен главное - полнота и достоверность.
ЗЫЖ в инете есть только неофициальные списки фич, а официальный текст платный