Главная » Просмотр файлов » Стандарт языка Си С99 TC

Стандарт языка Си С99 TC (1113411), страница 14

Файл №1113411 Стандарт языка Си С99 TC (Стандарт языка Си С99 + TC) 14 страницаСтандарт языка Си С99 TC (1113411) страница 142019-04-24СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 14)

Except as previously specified, theresult is implementation-defined, might not be correctly aligned, might not point to anentity of the referenced type, and might be a trap representation.56)6Any pointer type may be converted to an integer type.

Except as previously specified, theresult is implementation-defined. If the result cannot be represented in the integer type,the behavior is undefined. The result need not be in the range of values of any integertype.7A pointer to an object or incomplete type may be converted to a pointer to a differentobject or incomplete type. If the resulting pointer is not correctly aligned57) for thepointed-to type, the behavior is undefined.

Otherwise, when converted back again, theresult shall compare equal to the original pointer. When a pointer to an object is55) The macro NULL is defined in <stddef.h> (and other headers) as a null pointer constant; see 7.17.56) The mapping functions for converting a pointer to an integer or an integer to a pointer are intended tobe consistent with the addressing structure of the execution environment.57) In general, the concept ‘‘correctly aligned’’ is transitive: if a pointer to type A is correctly aligned for apointer to type B, which in turn is correctly aligned for a pointer to type C, then a pointer to type A iscorrectly aligned for a pointer to type C.§6.3.2.3Language47ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256converted to a pointer to a character type, the result points to the lowest addressed byte ofthe object.

Successive increments of the result, up to the size of the object, yield pointersto the remaining bytes of the object.8A pointer to a function of one type may be converted to a pointer to a function of anothertype and back again; the result shall compare equal to the original pointer. If a convertedpointer is used to call a function whose type is not compatible with the pointed-to type,the behavior is undefined.Forward references: cast operators (6.5.4), equality operators (6.5.9), integer typescapable of holding object pointers (7.18.1.4), simple assignment (6.5.16.1).48Language§6.3.2.3WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.4 Lexical elementsSyntax1token:keywordidentifierconstantstring-literalpunctuatorpreprocessing-token:header-nameidentifierpp-numbercharacter-constantstring-literalpunctuatoreach non-white-space character that cannot be one of the aboveConstraints2Each preprocessing token that is converted to a token shall have the lexical form of akeyword, an identifier, a constant, a string literal, or a punctuator.Semantics3A token is the minimal lexical element of the language in translation phases 7 and 8.

Thecategories of tokens are: keywords, identifiers, constants, string literals, and punctuators.A preprocessing token is the minimal lexical element of the language in translationphases 3 through 6. The categories of preprocessing tokens are: header names,identifiers, preprocessing numbers, character constants, string literals, punctuators, andsingle non-white-space characters that do not lexically match the other preprocessingtoken categories.58) If a ' or a " character matches the last category, the behavior isundefined. Preprocessing tokens can be separated by white space; this consists ofcomments (described later), or white-space characters (space, horizontal tab, new-line,vertical tab, and form-feed), or both. As described in 6.10, in certain circumstancesduring translation phase 4, white space (or the absence thereof) serves as more thanpreprocessing token separation.

White space may appear within a preprocessing tokenonly as part of a header name or between the quotation characters in a character constantor string literal.58) An additional category, placemarkers, is used internally in translation phase 4 (see 6.10.3.3); it cannotoccur in source files.§6.4Language49ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12564If the input stream has been parsed into preprocessing tokens up to a given character, thenext preprocessing token is the longest sequence of characters that could constitute apreprocessing token. There is one exception to this rule: header name preprocessingtokens are recognized only within #include preprocessing directives and inimplementation-defined locations within #pragma directives.

In such contexts, asequence of characters that could be either a header name or a string literal is recognizedas the former.5EXAMPLE 1 The program fragment 1Ex is parsed as a preprocessing number token (one that is not avalid floating or integer constant token), even though a parse as the pair of preprocessing tokens 1 and Exmight produce a valid expression (for example, if Ex were a macro defined as +1). Similarly, the programfragment 1E1 is parsed as a preprocessing number (one that is a valid floating constant token), whether ornot E is a macro name.6EXAMPLE 2 The program fragment x+++++y is parsed as x ++ ++ + y, which violates a constraint onincrement operators, even though the parse x ++ + ++ y might yield a correct expression.Forward references: character constants (6.4.4.4), comments (6.4.9), expressions (6.5),floating constants (6.4.4.2), header names (6.4.7), macro replacement (6.10.3), postfixincrement and decrement operators (6.5.2.4), prefix increment and decrement operators(6.5.3.1), preprocessing directives (6.10), preprocessing numbers (6.4.8), string literals(6.4.5).6.4.1 KeywordsSyntax1keyword: one ofautobreakcasecharconstcontinuedefaultdodoubleelseenumexternfloatforgotoifinlineintlongregisterrestrictreturnshortsignedsizeofstaticstructswitchtypedefunionunsignedvoidvolatilewhile_Bool_Complex_ImaginarySemantics2The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use askeywords, and shall not be used otherwise.

The keyword _Imaginary is reserved forspecifying imaginary types.59)59) One possible specification for imaginary types appears in annex G.50Language§6.4.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.4.2 Identifiers6.4.2.1 GeneralSyntax1identifier:identifier-nondigitidentifier identifier-nondigitidentifier digitidentifier-nondigit:nondigituniversal-character-nameother implementation-defined charactersnondigit: one of_ a bn oA BN OcpCPdqDQerERfsFSgtGThuHUivIVdigit: one of0 134567892jwJWkxKXlyLYmzMZSemantics2An identifier is a sequence of nondigit characters (including the underscore _, thelowercase and uppercase Latin letters, and other characters) and digits, which designatesone or more entities as described in 6.2.1.

Lowercase and uppercase letters are distinct.There is no specific limit on the maximum length of an identifier.3Each universal character name in an identifier shall designate a character whose encodingin ISO/IEC 10646 falls into one of the ranges specified in annex D.60) The initialcharacter shall not be a universal character name designating a digit.

An implementationmay allow multibyte characters that are not part of the basic source character set toappear in identifiers; which characters and their correspondence to universal characternames is implementation-defined.4When preprocessing tokens are converted to tokens during translation phase 7, if apreprocessing token could be converted to either a keyword or an identifier, it is convertedto a keyword.60) On systems in which linkers cannot accept extended characters, an encoding of the universal charactername may be used in forming valid external identifiers. For example, some otherwise unusedcharacter or sequence of characters may be used to encode the \u in a universal character name.Extended characters may produce a long external identifier.§6.4.2.1Language51ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Implementation limits5As discussed in 5.2.4.1, an implementation may limit the number of significant initialcharacters in an identifier; the limit for an external name (an identifier that has externallinkage) may be more restrictive than that for an internal name (a macro name or anidentifier that does not have external linkage).

The number of significant characters in anidentifier is implementation-defined.6Any identifiers that differ in a significant character are different identifiers. If twoidentifiers differ only in nonsignificant characters, the behavior is undefined.Forward references: universal character names (6.4.3), macro replacement (6.10.3).6.4.2.2 Predefined identifiersSemantics1The identifier _ _func_ _ shall be implicitly declared by the translator as if,immediately following the opening brace of each function definition, the declarationstatic const char _ _func_ _[] = "function-name";appeared, where function-name is the name of the lexically-enclosing function.61)2This name is encoded as if the implicit declaration had been written in the sourcecharacter set and then translated into the execution character set as indicated in translationphase 5.3EXAMPLEConsider the code fragment:#include <stdio.h>void myfunc(void){printf("%s\n", _ _func_ _);/* ...

Характеристики

Тип файла
PDF-файл
Размер
3,61 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6384
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее