Skip to content

Instantly share code, notes, and snippets.

@RealNeGate
Last active January 22, 2022 08:29
Show Gist options
  • Select an option

  • Save RealNeGate/b35d059ad388e469472c263087a028a8 to your computer and use it in GitHub Desktop.

Select an option

Save RealNeGate/b35d059ad388e469472c263087a028a8 to your computer and use it in GitHub Desktop.

J.3 Implementation-defined behavior:

J.3.1 Translation

How a diagnostic is identified (3.10, 5.1.1.3).

TODO

Whether each nonempty sequence of white-space characters other than new-line is retained or replaced by one space character in translation phase 3 (5.1.1.2).

non-newline whitespace is replaced by the space ' '

J.3.2 Environment

J.3.4 Characters

The number of bits in a byte (3.6).

8bits

The values of the members of the execution character set (5.2.1).

Which of signed char or unsigned char has the same range, representation, and behavior as "plain" char

char is an unsigned type.

J.3.5 Integers

Any extended integer types that exist in the implementation (6.2.5).

None exist currently.

Whether signed integer types are represented using sign and magnitude, two’s complement, or ones’ complement, and whether the extraordinary value is a trap representation or an ordinary value (6.2.6.2).

Two's complement with no trap values.

The rank of any extended integer type relative to another extended integer type with the same precision (6.3.1.1).

No extended integers exist.

The result of, or the signal raised by, converting an integer to a signed integer type when the value cannot be represented in an object of that type (6.3.1.3).

No signal is raised (TODO)

The results of some bitwise operations on signed integers (6.5).

Right shift on a signed integer type will result in an Arithmatic shift where the sign bit has it's position preserved.

J.3.6 Floating point

TODO

J.3.7 Arrays and pointers

The result of converting a pointer to an integer or vice versa (6.3.2.3):

The bit patterns are preserved.

Internal types of size_t, uintptr_t:

  • unsigned int for 32bit target.
  • unsigned long for 64bit posix-based target.
  • unsigned long long for 64bit windows-based target.

The size of the result of subtracting two pointers to elements of the same array (6.5.6):

Internal types of ptrdiff_t, intptr_t:

  • int for 32bit target.
  • long for 64bit posix-based target.
  • long long for 64bit windows-based target.

J.3.8 Hints

J.3.9 Structures, unions, enumerations, and bit-fields

Whether a "plain" int bit-field is treated as a signed int bit-field or as an unsigned int bit-field (6.7.2, 6.7.2.1).

By default, unsigned int.

Allowable bit-field types other than _Bool, signed int, and unsigned int (6.7.2.1)

signed long, signed long long, unsigned long, unsigned long long

Whether atomic types are permitted for bit-fields (6.7.2.1).

No.

Whether a bit-field can straddle a storage-unit boundary (6.7.2.1).

No.

The integer type compatible with each enumerated type (6.7.2.2).

Enumerated types are all int.

J.3.10 Qualifiers

What constitutes an access to an object that has volatile-qualified type (6.7.3).

The load and store cannot be split or replicated, unions and structs cannot be volatile.

J.5 Common extensions

J.5.1 Environment arguments

char *envp[] is allowed in main

J.5.2 Specialized identifiers

Dollar sign $ is allowed anywhere in an identifier

J.5.3 Lengths and cases of identifiers

All characters in identifiers (with or without external linkage) are significant.

J.5.4 Scopes of identifiers

A function identifier, or the identifier of an object the declaration of which contains the keyword extern, has file scope.

J.5.5 Writable string literals

string literals are immutable and thus are allowed to alias if they match.

J.5.6 Other arithmetic types

No additional arithmatic types.

J.5.7 Function pointer casts

A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function (6.5.4).

A pointer to a function may be cast to a pointer to an object or to void, allowing a function to be inspected or modified (for example, by a debugger) (6.5.4).

J.5.11 Multiple external definitions

There may be more than one external definition for the identifier of an object, with or without the explicit use of the keyword extern; if the definitions disagree, or more than one is initialized, this compilation will fail.

J.5.12 Predefined macro names

1 Macro names that do not begin with an underscore, describing the translation and execution environments, are defined by the implementation before translation begins (6.10.8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment