Skip to content

Commit 90b4937

Browse files
shiqinggdbkinder
authored andcommitted
doc: add rules related to implementation-specific behaviors
This patch adds some rules related to implementation-specific behaviors. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
1 parent e131d70 commit 90b4937

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

doc/developer-guides/coding_guidelines.rst

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,8 +2665,8 @@ ID-07: Name defined by developers shall not start with underscore
26652665
=================================================================
26662666

26672667
All names starting with one or two underscores are reserved for use by the
2668-
compiler and standard libraries to eliminate potential conflicts with user-
2669-
defined names.
2668+
compiler and standard libraries to eliminate potential conflicts with
2669+
user-defined names.
26702670

26712671
Compliant example::
26722672

@@ -3255,3 +3255,58 @@ Compliant example::
32553255
};
32563256

32573257

3258+
Implementation-specific Behaviors
3259+
*********************************
3260+
3261+
3262+
IB-01: All characters in an identifier are significant initial characters
3263+
=========================================================================
3264+
3265+
The number of significant initial characters in an identifier is
3266+
implementation-defined, according to J.3.3 item 2 in C99. For ACRN hypervisor,
3267+
all characters in an identifier are significant initial characters.
3268+
3269+
IB-02: The number of bits in a byte is 8
3270+
========================================
3271+
3272+
The number of bits in a byte is implementation-defined, according to J.3.4 item
3273+
1 in C99. For ACRN hypervisor, the number of bits in a byte is 8.
3274+
3275+
IB-03: The values of the members of the execution character set depends on ASCII Table
3276+
======================================================================================
3277+
3278+
The values of the members of the execution character set is
3279+
implementation-defined, according to J.3.4 item 2 in C99. For ACRN hypervisor,
3280+
characters are encoded in ASCII. This rule applies to the source code that is
3281+
being compiled. Non-ASCII characters are allowed in comments, such as the author
3282+
name.
3283+
3284+
IB-04: 'plain' char is equivalent to signed char
3285+
=================================================
3286+
3287+
The underlying type of 'plain' char is implementation-defined, according to
3288+
J.3.4 item 5 in C99. For ACRN hypervisor, 'plain' char is equivalent to signed
3289+
char.
3290+
3291+
IB-05: Signed integers are represented in two's complement
3292+
==========================================================
3293+
3294+
Whether signed integer types are represented using sign and magnitude, two's
3295+
complement, or ones' complement is implementation-defined, according to J.3.5
3296+
item 2 in C99. For ACRN hypervisor, signed integers are represented in two's
3297+
complement.
3298+
3299+
IB-06: The integer type compatible with each enumerated type is case by case
3300+
============================================================================
3301+
3302+
The integer type compatible with each enumerated type is implementation-defined,
3303+
according to J.3.9 item 6 in C99. For ACRN hypervisor, if the enum has no
3304+
negative underlying values, unsigned int is used; otherwise, int is used.
3305+
3306+
IB-07: The number of bytes in an object is specified
3307+
====================================================
3308+
3309+
The number of bytes in an object is implementation-defined, according to J.3.13
3310+
item 2 in C99. For ACRN hypervisor, char is 1 byte, short is 2 bytes, int is 4
3311+
bytes, long is 8 bytes, and long long is not used.
3312+

0 commit comments

Comments
 (0)