この規格 プレビューページの目次
※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。
3. 用語、定義および記号
この文書の目的上、ISO/IEC 2382, ISO 80000-2, および以下で与えられる用語と定義が適用されます。
ISO と IEC は、標準化に使用する用語データベースを次のアドレスで維持しています。
追加の用語は、イタリック体または構文ルールの左側に表示されるwhere 定義されます。この文書で明示的に定義されている用語は、他の場所で定義されている同様の用語を暗黙的に参照しているものとはみなされません。
3.1
アクセス(動詞)
(実行時アクション) オブジェクトの値を読み取るか変更する
注記 1:これら 2 つのアクションのうちの 1 つだけを意味する場合、「読み取り」または「変更」が使用されます。
注記 2: 「変更」には、格納される新しい値が以前の値と同じであるwhere も含まれます。
注 3:評価されない式はオブジェクトにアクセスしません。
3.2
アライメント
特定のタイプのオブジェクトが、バイト アドレスの特定の倍数であるアドレスを持つストレージ境界上に配置されるという要件
3.3
口論
実引数
非推奨: 実際のパラメータ
関数呼び出し式のかっこで囲まれたコンマ区切りリスト内の式、または関数のようなマクロ呼び出しのかっこで囲まれたコンマ区切りリスト内の一連の前処理トークン
3.4
行動
外見とか行動とか
3.4.1
実装定義の動作
各実装で選択がどのように行われるかを文書化する不特定のwhere
注記 1: J.3 は、実装定義の動作につながる C プログラムのプロパティの概要を示しています。
例:
実装定義の動作の例としては、符号付き整数が右シフトされた場合の上位ビットの伝播が挙げられます。
3.4.2
ロケール固有の動作
各実装が文書化する国籍、文化、言語に関する地域の慣習に依存する動作
注 1: J.4 は、ロケール固有の動作につながる C プログラムのプロパティの概要を示しています。
例:
ロケール固有の動作の例としては、 is lower 関数が 26 個の小文字のラテン文字以外の文字に対して true を返すかどうかが挙げられます。
3.4.3
未定義の動作
移植性のない、または誤ったプログラム構成または誤ったデータの使用時の動作(この文書では要件を課していません)
注記 1:考えられる未定義の動作は、状況を完全に無視して予測できない結果をもたらすこと、翻訳またはプログラムの実行中に環境に特有の方法で文書化される動作 (診断メッセージの発行の有無にかかわらず)、翻訳またはプログラムの実行の終了まで多岐にわたります。実行 (診断メッセージの発行を伴う)
注記 2: J.2 は、未定義の動作を引き起こす C プログラムのプロパティの概要を示しています。
例:
未定義の動作の例としては、整数オーバーフロー時の動作が挙げられます。
3.4.4
不特定の動作
未指定の値の使用から生じる動作、またはこの文書が 2 つ以上の可能性を提供し、いかなる場合にも選択されるその他の要件を課さないその他の動作
注記 1: J.1 は、不特定の動作を引き起こす C プログラムのプロパティの概要を示しています。
例:
未指定の動作の例としては、関数の引数が評価される順序が挙げられます。
3.5
少し
2 つの値のうちの 1 つを持つことができるオブジェクトを保持するのに十分な大きさの、実行環境内のデータ ストレージの単位
注記 1:オブジェクトの個々のビットのアドレスを表現できる必要はありません。
3.6
バイト
実行環境の基本文字セットのメンバーを保持するのに十分な大きさの、アドレス指定可能なデータ ストレージの単位
注記 1:オブジェクトの各バイトのアドレスを一意に表現することが可能です。
注記 2:バイトは連続したビットのシーケンスで構成され、その数は実装で定義されます。最下位ビットは下位ビットと呼ばれます。最上位ビットは上位ビットと呼ばれます。
3.7
キャラクター
3.7.1
キャラクター
半角文字
(C) バイトに収まるビット表現
3.7.2
マルチバイト文字
ソース環境または実行環境の拡張文字セットのメンバーを表す 1 つ以上のバイトのシーケンス
注記 1:拡張文字セットは、基本文字セットのスーパーセットです。
3.7.3
ワイド文字
wchar_t 型のオブジェクトで表現可能な値。現在のロケールの任意の文字を表現できます。
3.8
制約
言語要素の露出を解釈するための構文的または意味的な制限
3.9
正しく丸められた結果
現在の丸めモードに従い、結果に無制限の範囲と精度が与えられるものに最も近い値の結果形式での表現
注記 1:この文書では、「正しく丸められた」という言葉の直後に「結果」が続かない場合、これが意図された使用法です。
3.10
診断メッセージ
実装のメッセージ出力の実装定義のサブセットに属するメッセージ
3.11
前方参照
この節に関連する追加情報を含む、このドキュメントの後の節への参照
3.12
実装
特定の制御オプションの下で特定の変換環境で実行され、特定の実行環境向けにプログラムの変換を実行し、特定の実行環境での機能の実行をサポートする、特定のソフトウェアのセット
3.13
実装制限
実装によってプログラムに課される制限
3.14
記憶の場所
スカラー型のオブジェクト、またはすべて非ゼロ幅を持つ隣接するビットフィールドの最大シーケンスのいずれか
注記 1: 2 つの実行スレッドは、互いに干渉することなく、別々のメモリ位置を更新およびアクセスできます。
注記 2:ビットフィールドメンバーと隣接する非ビットフィールドメンバーは、別個のメモリー位置にあります。同じことが 2 つのビットフィールドにも当てはまります。一方がネスト構造宣言内で宣言され、もう一方が宣言されていない場合、または 2 つが長さ 0 のビットフィールド宣言で区切られている場合、または非ビットフィールドで区切られている場合、 -フィールドメンバー宣言。その間で宣言されたすべてのメンバーも (長さがゼロではない) ビットフィールドである場合、間にあるビットフィールドのサイズがどのようなものであっても、同じ構造内の 2 つの非アトミック ビットフィールドを同時に更新することは安全ではありません。
例:
構造体{
文字 a;
int b:5, c:11, :0, d:8;
構造体{ int ee:8;} e;
}3.15
物体
実行環境内のデータ ストレージの領域。その内容は値を表すことができます。
注 1:オブジェクトは、参照されると、特定の型を持つものとして解釈されます。 6.3.2.1を参照してください。
3.16
パラメータ
仮パラメータ
非推奨: 仮引数
関数宣言または関数定義の一部として宣言され、関数への入口で値を取得するか、関数のようなマクロ定義内のマクロ名の直後の括弧で囲まれたコンマ区切りのリストから識別子を取得するオブジェクト
3.17
推奨される練習方法
標準の意図に沿うものとして強く推奨されている仕様ですが、実装によっては実用的でない可能性があります。
3.18
実行時の制約
ライブラリ関数を呼び出すときのプログラムの要件
注記 1: 用語は似ていますが、実行時制約は 3.8 で定義されているような制約ではなく、翻訳時に診断する必要はありません。
注記 2:付属書 K の拡張機能をサポートする実装では、ライブラリ関数の実行時制約がプログラムによって違反されていないことを検証する必要があります。 K.3.1.4を参照してください。
注記 3:付属書 L をサポートする実装は、トラップを実行するときに実行時制約ハンドラーを呼び出すことが許可されます。
3.19
価値
特定の型を持つものとして解釈された場合のオブジェクトの内容の正確な意味
3.19.1
実装定義の値
各実装で選択がどのように行われるかを文書化する未指定のwhere
3.19.2
不定値
未指定の値またはトラップ表現のいずれか
3.19.3
不特定の値
関連するタイプの有効な値。このドキュメントwhere どのような場合でもどの値が選択されるかについて要件を課していません。
注 1:未指定の値をトラップ表現にすることはできません。
3.19.4
トラップ表現
オブジェクト型の値を表す必要のないオブジェクト表現
3.19.5
罠を実行する
それ以上の操作が実行されないようにプログラムの実行を中断する
注記 1:この文書では、「トラップ」という単語の直後に「表現」が続かない場合、これが意図された使用法です。 2)
注記 2:付属書 L をサポートする実装は、トラップを実行するときに実行時制約ハンドラーを呼び出すことが許可されます。
3.20
⌈ x ⌉
x の天井
x 以上の最小の整数
例:
⌈2.4⌉は3, ⌈−2.4⌉は−2です。
3.21
⌊ x ⌋
x の床
x 以下の最大の整数
例:
⌊2.4⌋は2, ⌊−2.4⌋は−3です。
参考文献
| [1] | ISO/IEC 646:1991, 情報技術 - 情報交換用のISO 7 ビット コード化文字セット |
| [2] | ISO/IEC 9945-2:1993, 情報技術 — ポータブル オペレーティング システム インターフェイス (POSIX) — Part 2: シェルとユーティリティ |
| [3] | ISO/IEC TR 10176:2003, 情報技術 - プログラミング言語標準の作成に関するガイドライン |
| [4] | ISO/IEC 10967-1:2012, 情報技術 — 言語に依存しない演算 — Part 1: 整数および浮動小数点演算 |
| [5] | ISO/IEC TR 19769:2004, 情報技術 — プログラミング言語、その環境およびシステム ソフトウェア インターフェイス — 新しい文字データ型をサポートするためのプログラミング言語 C の拡張 |
| [6] | ISO/IEC TR 24731-1:2007, 情報技術 — プログラミング言語、その環境およびシステム ソフトウェア インターフェイス — C ライブラリの拡張 — Part 1: 境界チェック インターフェイス |
| [7] | ANSI/IEEE 754-1985, 2進浮動小数点演算に関する米国国家規格 |
| [8] | ANSI/IEEE 854-1988, 基数に依存しない浮動小数点演算に関する米国国家規格 |
| [9] | ANSI X3/TR-1-8, American National Dictionary for Information Processing Systems, 情報処理システム技術レポート |
| [10] | デニス M. リッチー著の「The C Reference Manual」。そのバージョンは、Brian W. Kernighan と Dennis M. Ritchie 著のThe C Programming Language 、Prentice-Hall, Inc. (1978) で出版されました。著作権はAT&Tが所有します |
| [11] | 1984/usr/group 標準委員会、米国カリフォルニア州サンタクララ、1984 年 11 月による/usr/group 標準 |
3. Terms, definitions and symbols
For the purposes of this document, the terms and definitions given in ISO/IEC 2382, ISO 80000-2, and the following apply.
ISO and IEC maintain terminological databases for use in standardization at the following addresses:
Additional terms are defined where they appear in italic type or on the left side of a syntax rule. Terms explicitly defined in this document are not to be presumed to refer implicitly to similar terms defined elsewhere.
3.1
access (verb)
(execution-time action) to read or modify the value of an object
Note 1 to entry: Where only one of these two actions is meant,"read" or"modify" is used.
Note 2 to entry:"Modify" includes the case where the new value being stored is the same as the previous value.
Note 3 to entry: Expressions that are not evaluated do not access objects.
3.2
alignment
requirement that objects of a particular type be located on storage boundaries with addresses that are particular multiples of a byte address
3.3
argument
actual argument
DEPRECATED: actual parameter
expression in the comma-separated list bounded by the parentheses in a function call expression, or a sequence of preprocessing tokens in the comma-separated list bounded by the parentheses in a function-like macro invocation
3.4
behavior
external appearance or action
3.4.1
implementation-defined behavior
unspecified behavior where each implementation documents how the choice is made
Note 1 to entry: J.3 gives an overview over properties of C programs that lead to implementation-defined behavior.
EXAMPLE:
An example of implementation-defined behavior is the propagation of the high-order bit when a signed integer is shifted right.
3.4.2
locale-specific behavior
behavior that depends on local conventions of nationality, culture, and language that each implementation documents
Note 1 to entry: J.4 gives an overview over properties of C programs that lead to locale-specific behavior.
EXAMPLE:
An example of locale-specific behavior is whether the islower function returns true for characters other than the 26 lowercase Latin letters.
3.4.3
undefined behavior
behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this document imposes no requirements
Note 1 to entry: Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).
Note 2 to entry: J.2 gives an overview over properties of C programs that lead to undefined behavior.
EXAMPLE:
An example of undefined behavior is the behavior on integer overflow.
3.4.4
unspecified behavior
behavior, that results from the use of an unspecified value, or other behavior upon which this document provides two or more possibilities and imposes no further requirements on which is chosen in any instance
Note 1 to entry: J.1 gives an overview over properties of C programs that lead to unspecified behavior.
EXAMPLE:
An example of unspecified behavior is the order in which the arguments to a function are evaluated.
3.5
bit
unit of data storage in the execution environment large enough to hold an object that can have one of two values
Note 1 to entry: It need not be possible to express the address of each individual bit of an object.
3.6
byte
addressable unit of data storage large enough to hold any member of the basic character set of the execution environment
Note 1 to entry: It is possible to express the address of each individual byte of an object uniquely.
Note 2 to entry: A byte is composed of a contiguous sequence of bits, the number of which is implementation-defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit.
3.7
character
3.7.1
character
single-byte character
(C) bit representation that fits in a byte
3.7.2
multibyte character
sequence of one or more bytes representing a member of the extended character set of either the source or the execution environment
Note 1 to entry: The extended character set is a superset of the basic character set.
3.7.3
wide character
value representable by an object of type wchar_t , capable of representing any character in the current locale
3.8
constraint
restriction, either syntactic or semantic, by which the exposition of language elements is to be interpreted
3.9
correctly rounded result
representation in the result format that is nearest in value, subject to the current rounding mode, to what the result would be given unlimited range and precision
Note 1 to entry: In this document, when the words"correctly rounded" are not immediately followed by"result", this is the intended usage.
3.10
diagnostic message
message belonging to an implementation-defined subset of the implementation’s message output
3.11
forward reference
reference to a later subclause of this document that contains additional information relevant to this subclause
3.12
implementation
particular set of software, running in a particular translation environment under particular control options, that performs translation of programs for, and supports execution of functions in, a particular execution environment
3.13
implementation limit
restriction imposed upon programs by the implementation
3.14
memory location
either an object of scalar type, or a maximal sequence of adjacent bit-fields all having nonzero width
Note 1 to entry: Two threads of execution can update and access separate memory locations without interfering with each other.
Note 2 to entry: A bit-field and an adjacent non-bit-field member are in separate memory locations. The same applies to two bit-fields, if one is declared inside a nested structure declaration and the other is not, or if the two are separated by a zero-length bit-field declaration, or if they are separated by a non-bit-field member declaration. It is not safe to concurrently update two non-atomic bit-fields in the same structure if all members declared between them are also (nonzero-length) bit-fields, no matter what the sizes of those intervening bit-fields happen to be.
EXAMPLE:
struct {
char a;
int b:5, c:11,:0, d:8;
struct { int ee:8;} e;
}3.15
object
region of data storage in the execution environment, the contents of which can represent values
Note 1 to entry: When referenced, an object can be interpreted as having a particular type; see 6.3.2.1.
3.16
parameter
formal parameter
DEPRECATED: formal argument
object declared as part of a function declaration or definition that acquires a value on entry to the function, or an identifier from the comma-separated list bounded by the parentheses immediately following the macro name in a function-like macro definition
3.17
recommended practice
specification that is strongly recommended as being in keeping with the intent of the standard, but that might be impractical for some implementations
3.18
runtime-constraint
requirement on a program when calling a library function
Note 1 to entry: Despite the similar terms, a runtime-constraint is not a kind of constraint as defined by 3.8, and need not be diagnosed at translation time.
Note 2 to entry: Implementations that support the extensions in Annex K are required to verify that the runtime-constraints for a library function are not violated by the program; see K.3.1.4.
Note 3 to entry: Implementations that support Annex L are permitted to invoke a runtime-constraint handler when they perform a trap.
3.19
value
precise meaning of the contents of an object when interpreted as having a specific type
3.19.1
implementation-defined value
unspecified value where each implementation documents how the choice is made
3.19.2
indeterminate value
either an unspecified value or a trap representation
3.19.3
unspecified value
valid value of the relevant type where this document imposes no requirements on which value is chosen in any instance
Note 1 to entry: An unspecified value cannot be a trap representation.
3.19.4
trap representation
an object representation that need not represent a value of the object type
3.19.5
perform a trap
interrupt execution of the program such that no further operations are performed
Note 1 to entry: In this document, when the word"trap" is not immediately followed by"representation", this is the intended usage. 2)
Note 2 to entry: Implementations that support Annex L are permitted to invoke a runtime-constraint handler when they perform a trap.
3.20
⌈x⌉
ceiling of x
the least integer greater than or equal to x
EXAMPLE:
⌈2.4⌉ is 3, ⌈−2.4⌉ is −2.
3.21
⌊x⌋
floor of x
the greatest integer less than or equal to x
EXAMPLE:
⌊2.4⌋ is 2, ⌊−2.4⌋ is −3.
Bibliography
| [1] | ISO/IEC 646:1991, Information technology — ISO 7-bit coded character set for information interchange |
| [2] | ISO/IEC 9945-2:1993, Information technology — Portable Operating System Interface (POSIX) — Part 2: Shell and Utilities |
| [3] | ISO/IEC TR 10176:2003, Information technology — Guidelines for the preparation of programming language standards |
| [4] | ISO/IEC 10967-1:2012, Information technology — Language independent arithmetic — Part 1: Integer and floating point arithmetic |
| [5] | ISO/IEC TR 19769:2004, Information technology — Programming languages, their environments and system software interfaces — Extensions for the programming language C to support new character data types |
| [6] | ISO/IEC TR 24731-1:2007, Information technology — Programming languages, their environments and system software interfaces — Extensions to the C library — Part 1: Bounds-checkinginterfaces |
| [7] | ANSI/IEEE 754-1985, American National Standard for Binary Floating-Point Arithmetic |
| [8] | ANSI/IEEE 854-1988, American National Standard for Radix-Independent Floating-Point Arithmetic |
| [9] | ANSI X3/TR-1-82 (1982), American National Dictionary for Information Processing Systems, Information Processing Systems Technical Report |
| [10] | "The C Reference Manual" by Dennis M. Ritchie, a version of which was published in The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie, Prentice-Hall, Inc., (1978). Copyright owned by AT&T |
| [11] | 1984/usr/group Standard by the/usr/group Standards Committee, Santa Clara, California, USA, November 1984 |