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

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

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

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

Theyaretruewhich expands to the integer constant 1,falsewhich expands to the integer constant 0, and_ _bool_true_false_are_definedwhich expands to the integer constant 1.4Notwithstanding the provisions of 7.1.3, a program may undefine and perhaps thenredefine the macros bool, true, and false.222)222) See ‘‘future library directions’’ (7.26.7).§7.16Library253ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.17 Common definitions <stddef.h>1The following types and macros are defined in the standard header <stddef.h>.

Someare also defined in other headers, as noted in their respective subclauses.2The types areptrdiff_twhich is the signed integer type of the result of subtracting two pointers;size_twhich is the unsigned integer type of the result of the sizeof operator; andwchar_twhich is an integer type whose range of values can represent distinct codes for allmembers of the largest extended character set specified among the supported locales; thenull character shall have the code value zero.

Each member of the basic character setshall have a code value equal to its value when used as the lone character in an integercharacterconstantifanimplementationdoesnotdefine_ _STDC_MB_MIGHT_NEQ_WC_ _.3The macros areNULLwhich expands to an implementation-defined null pointer constant; andoffsetof(type, member-designator)which expands to an integer constant expression that has type size_t, the value ofwhich is the offset in bytes, to the structure member (designated by member-designator),from the beginning of its structure (designated by type).

The type and member designatorshall be such that givenstatic type t;then the expression &(t.member-designator) evaluates to an address constant. (If thespecified member is a bit-field, the behavior is undefined.)Recommended practice4The types used for size_t and ptrdiff_t should not have an integer conversion rankgreater than that of signed long int unless the implementation supports objectslarge enough to make this necessary.Forward references: localization (7.11).254Library§7.17WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.18 Integer types <stdint.h>1The header <stdint.h> declares sets of integer types having specified widths, anddefines corresponding sets of macros.223) It also defines macros that specify limits ofinteger types corresponding to types defined in other standard headers.2Types are defined in the following categories:— integer types having certain exact widths;— integer types having at least certain specified widths;— fastest integer types having at least certain specified widths;— integer types wide enough to hold pointers to objects;— integer types having greatest width.(Some of these types may denote the same type.)3Corresponding macros specify limits of the declared types and construct suitableconstants.4For each type described herein that the implementation provides,224) <stdint.h> shalldeclare that typedef name and define the associated macros.

Conversely, for each typedescribed herein that the implementation does not provide, <stdint.h> shall notdeclare that typedef name nor shall it define the associated macros. An implementationshall provide those types described as ‘‘required’’, but need not provide any of the others(described as ‘‘optional’’).7.18.1 Integer types1When typedef names differing only in the absence or presence of the initial u are defined,they shall denote corresponding signed and unsigned types as described in 6.2.5; animplementation providing one of these corresponding types shall also provide the other.2In the following descriptions, the symbol N represents an unsigned decimal integer withno leading zeros (e.g., 8 or 24, but not 04 or 048).223) See ‘‘future library directions’’ (7.26.8).224) Some of these types may denote implementation-defined extended integer types.§7.18.1Library255ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.18.1.1 Exact-width integer types1The typedef name intN_t designates a signed integer type with width N , no paddingbits, and a two’s complement representation.

Thus, int8_t denotes a signed integertype with a width of exactly 8 bits.2The typedef name uintN_t designates an unsigned integer type with width N . Thus,uint24_t denotes an unsigned integer type with a width of exactly 24 bits.3These types are optional. However, if an implementation provides integer types withwidths of 8, 16, 32, or 64 bits, no padding bits, and (for the signed types) that have atwo’s complement representation, it shall define the corresponding typedef names.7.18.1.2 Minimum-width integer types1The typedef name int_leastN_t designates a signed integer type with a width of atleast N , such that no signed integer type with lesser size has at least the specified width.Thus, int_least32_t denotes a signed integer type with a width of at least 32 bits.2The typedef name uint_leastN_t designates an unsigned integer type with a widthof at least N , such that no unsigned integer type with lesser size has at least the specifiedwidth.

Thus, uint_least16_t denotes an unsigned integer type with a width of atleast 16 bits.3The following types are required:int_least8_tint_least16_tint_least32_tint_least64_tuint_least8_tuint_least16_tuint_least32_tuint_least64_tAll other types of this form are optional.7.18.1.3 Fastest minimum-width integer types1Each of the following types designates an integer type that is usually fastest225) to operatewith among all integer types that have at least the specified width.2The typedef name int_fastN_t designates the fastest signed integer type with a widthof at least N . The typedef name uint_fastN_t designates the fastest unsigned integertype with a width of at least N .225) The designated type is not guaranteed to be fastest for all purposes; if the implementation has no cleargrounds for choosing one type over another, it will simply pick some integer type satisfying thesignedness and width requirements.256Library§7.18.1.3WG14/N12563Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3The following types are required:int_fast8_tint_fast16_tint_fast32_tint_fast64_tuint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_tAll other types of this form are optional.7.18.1.4 Integer types capable of holding object pointers1The following type designates a signed integer type with the property that any validpointer to void can be converted to this type, then converted back to pointer to void,and the result will compare equal to the original pointer:intptr_tThe following type designates an unsigned integer type with the property that any validpointer to void can be converted to this type, then converted back to pointer to void,and the result will compare equal to the original pointer:uintptr_tThese types are optional.7.18.1.5 Greatest-width integer types1The following type designates a signed integer type capable of representing any value ofany signed integer type:intmax_tThe following type designates an unsigned integer type capable of representing any valueof any unsigned integer type:uintmax_tThese types are required.7.18.2 Limits of specified-width integer types1The following object-like macros226) specify the minimum and maximum limits of thetypes declared in <stdint.h>.

Each macro name corresponds to a similar type name in7.18.1.2Each instance of any defined macro shall be replaced by a constant expression suitablefor use in #if preprocessing directives, and this expression shall have the same type aswould an expression that is an object of the corresponding type converted according to226) C++ implementations should define these macros only when _ _STDC_LIMIT_MACROS is definedbefore <stdint.h> is included.§7.18.2Library257ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256the integer promotions.

Its implementation-defined value shall be equal to or greater inmagnitude (absolute value) than the corresponding value given below, with the same sign,except where stated to be exactly the given value.7.18.2.1 Limits of exact-width integer types1— minimum values of exact-width signed integer typesINTN_MINexactly −(2 N −1 )— maximum values of exact-width signed integer typesINTN_MAXexactly 2 N −1 − 1— maximum values of exact-width unsigned integer typesUINTN_MAXexactly 2 N − 17.18.2.2 Limits of minimum-width integer types1— minimum values of minimum-width signed integer types−(2 N −1 − 1)INT_LEASTN_MIN— maximum values of minimum-width signed integer types2 N −1 − 1INT_LEASTN_MAX— maximum values of minimum-width unsigned integer types2N − 1UINT_LEASTN_MAX7.18.2.3 Limits of fastest minimum-width integer types1— minimum values of fastest minimum-width signed integer types−(2 N −1 − 1)INT_FASTN_MIN— maximum values of fastest minimum-width signed integer types2 N −1 − 1INT_FASTN_MAX— maximum values of fastest minimum-width unsigned integer types2N − 1UINT_FASTN_MAX7.18.2.4 Limits of integer types capable of holding object pointers1— minimum value of pointer-holding signed integer type−(215 − 1)INTPTR_MIN— maximum value of pointer-holding signed integer type215 − 1INTPTR_MAX258Library§7.18.2.4WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3— maximum value of pointer-holding unsigned integer type216 − 1UINTPTR_MAX7.18.2.5 Limits of greatest-width integer types1— minimum value of greatest-width signed integer type−(263 − 1)INTMAX_MIN— maximum value of greatest-width signed integer type263 − 1INTMAX_MAX— maximum value of greatest-width unsigned integer type264 − 1UINTMAX_MAX7.18.3 Limits of other integer types1The following object-like macros227) specify the minimum and maximum limits ofinteger types corresponding to types defined in other standard headers.2Each instance of these macros shall be replaced by a constant expression suitable for usein #if preprocessing directives, and this expression shall have the same type as would anexpression that is an object of the corresponding type converted according to the integerpromotions.

Its implementation-defined value shall be equal to or greater in magnitude(absolute value) than the corresponding value given below, with the same sign. Animplementation shall define only the macros corresponding to those typedef names itactually provides.228)— limits of ptrdiff_tPTRDIFF_MINPTRDIFF_MAX−65535+65535— limits of sig_atomic_tsee belowsee belowSIG_ATOMIC_MINSIG_ATOMIC_MAX— limit of size_tSIZE_MAX65535— limits of wchar_t227) C++ implementations should define these macros only when _ _STDC_LIMIT_MACROS is definedbefore <stdint.h> is included.228) A freestanding implementation need not provide all of these types.§7.18.3Library259ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256see belowsee belowWCHAR_MINWCHAR_MAX— limits of wint_tsee belowsee belowWINT_MINWINT_MAX3If sig_atomic_t (see 7.14) is defined as a signed integer type, the value ofSIG_ATOMIC_MIN shall be no greater than −127 and the value of SIG_ATOMIC_MAXshall be no less than 127; otherwise, sig_atomic_t is defined as an unsigned integertype, and the value of SIG_ATOMIC_MIN shall be 0 and the value ofSIG_ATOMIC_MAX shall be no less than 255.4If wchar_t (see 7.17) is defined as a signed integer type, the value of WCHAR_MINshall be no greater than −127 and the value of WCHAR_MAX shall be no less than 127;otherwise, wchar_t is defined as an unsigned integer type, and the value ofWCHAR_MIN shall be 0 and the value of WCHAR_MAX shall be no less than 255.229)5If wint_t (see 7.24) is defined as a signed integer type, the value of WINT_MIN shallbe no greater than −32767 and the value of WINT_MAX shall be no less than 32767;otherwise, wint_t is defined as an unsigned integer type, and the value of WINT_MINshall be 0 and the value of WINT_MAX shall be no less than 65535.7.18.4 Macros for integer constants1The following function-like macros230) expand to integer constants suitable forinitializing objects that have integer types corresponding to types defined in<stdint.h>.

Each macro name corresponds to a similar type name in 7.18.1.2 or7.18.1.5.2The argument in any instance of these macros shall be an unsuffixed integer constant (asdefined in 6.4.4.1) with a value that does not exceed the limits for the corresponding type.3Each invocation of one of these macros shall expand to an integer constant expressionsuitable for use in #if preprocessing directives. The type of the expression shall havethe same type as would an expression of the corresponding type converted according tothe integer promotions. The value of the expression shall be that of the argument.229) The values WCHAR_MIN and WCHAR_MAX do not necessarily correspond to members of the extendedcharacter set.230) C++ implementations should define these macros only when _ _STDC_CONSTANT_MACROS isdefined before <stdint.h> is included.260Library§7.18.4WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.18.4.1 Macros for minimum-width integer constants1The macro INTN_C(value) shall expand to an integer constant expressioncorresponding to the type int_leastN_t.

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

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

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

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