Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

En direct de la tete de Dan Pop

3 réponses
Avatar
Emmanuel Delahaye
La liste (non exhaustive) des 'last minute changes' entre N869 et C99:

From the last part of 6.2.6.2p2 on:

- the corresponding value with sign bit 0 is negated (sign
and magnitude);

- the sign bit has the value -(2**N) (two's complement);

- the sign bit has the value -(2**N - 1) (one's complement).

Which of these applies is implementation-defined, as is
whether the value with sign bit 1 and all value bits zero
(for the first two), or with sign bit and all value bits 1 (for
one's complement), is a trap representation or a normal value.
In the case of sign and magnitude and one's complement, if this
representation is a normal value it is called a negative zero.

3 If the implementation supports negative zeros, they shall be
generated only by:

- the &, |, ^, ~, <<, and >> operators with arguments that
produce such a value;

- the +, -, *, /, and % operators where one argument is a negative
zero and the result is zero;

- compound assignment operators based on the above cases.

It is unspecified whether these cases actually generate a
negative zero or a normal zero, and whether a negative zero
becomes a normal zero when stored in an object.

4 If the implementation does not support negative zeros, the
behavior of the &, |, ^, ~, <<, and >> operators with arguments
that would produce such a value is undefined.

========================================================================

6.3.1.3 Signed and unsigned integers

3 Otherwise, the new type is signed and the value cannot be
represented in it; either the result is implementation-defined
^^^^^^
or an implementation-defined signal is raised.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

========================================================================

6.5.2.3p5 (The first statement in the N869 version is missing in the final
version, which turns implementation-defined behaviour into undefined
behaviour.)

5 One special guarantee is made in order to simplify the use of
unions: if a union contains several structures that share a
common initial sequence (see below), and if the union object
currently contains one of these structures, it is permitted to
inspect the common initial part of any of them anywhere that
a declaration of the complete type of the union is visible.
Two structures share a common initial sequence if corresponding
members have compatible types (and, for bit-fields, the same
widths) for a sequence of one or more initial members.

========================================================================

6.10.8 Predefined macro names

5 The implementation shall not predefine the macro __cplusplus,
nor shall it define it in any standard header.

========================================================================

7.18.1.1 Exact-width integer types

1 The typedef name intN_t designates a signed integer type with
width N, no padding bits, and a two's complement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
representation. Thus, int8_t denotes a signed integer type with
^^^^^^^^^^^^^^^
a width of exactly 8 bits.

========================================================================

7.20.4.4 The _Exit function

Synopsis

1 #include <stdlib.h>
void _Exit(int status);

Description

2 The _Exit function causes normal program termination to occur
and control to be returned to the host environment. No functions
registered by the atexit function or signal handlers registered
by the signal function are called. The status returned to the host
environment is determined in the same way as for the exit function
(7.20.4.3). Whether open streams with unwritten buffered data
are flushed, open streams are closed, or temporary files are
removed is implementation-defined.

Returns

3 The _Exit function cannot return to its caller.


--
-ed- emdelYOURBRA@noos.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
<blank line>
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/

3 réponses

Avatar
Marc Lasson
Emmanuel Delahaye wrote:

La liste (non exhaustive) des 'last minute changes' entre N869 et C99:


[...]


======================================================================= >
7.18.1.1 Exact-width integer types

1 The typedef name intN_t designates a signed integer type with
width N, no padding bits, and a two's complement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
representation. Thus, int8_t denotes a signed integer type with
^^^^^^^^^^^^^^^
a width of exactly 8 bits.

=======================================================================
"no padding bits", ca veut dire que intN_t n'est définit que pour les N

qui sont des puissances de deux ? quels sont les valeurs possibles pour
N ? Où sont définit ces typedef ?

[...]

--
Marc.

Avatar
Gabriel Dos Reis
j'avais cru comprendre que tu recusais ce qu'écrit Dan Pop <g>

-- Gaby
Avatar
Richard Delorme

"no padding bits", ca veut dire que intN_t n'est définit que pour les N
qui sont des puissances de deux ?


Cela veut dire que tous les bits ont une valeur, et donc pas de bits de
remplissage ni pas de représentation piège.

quels sont les valeurs possibles pour
N ?


8, 16, 32, 64

Où sont définit ces typedef ?


#include <stdint.h>

--
Richard