diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-03-10 20:45:49 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-03-12 20:04:59 -0400 |
commit | 919ad8d5fbb1caa18c3719304ffeeb0e0dde1bb5 (patch) | |
tree | 132067179a5e418dd3f565e001a249824c48d268 /src/mman/mlock.c | |
parent | eb5ae94016f0e3e4fb7d0715346b09335f14655d (diff) | |
download | musl-919ad8d5fbb1caa18c3719304ffeeb0e0dde1bb5.tar.gz |
explicitly use signed keyword to define intNN_t and derivative types
standing alone, both the signed and int keywords identify the same
type, a (signed) int. however the C language has an exception where,
when the lone keyword int is used to declare a bitfield, it's
implementation-defined whether the bitfield is signed or unsigned. C11
footnote 125 extends this implementation-definedness to typedefs, and
DR#315 extends it to other integer types (for which support with
bitfields is implementation-defined).
while reasonable ABIs (all the ones we support) define bitfields as
signed by default, GCC and compatible compilers offer an option
-funsigned-bitfields to change the default. while any signed types
defined without explicit use of the signed keyword are affected, the
stdint.h types, especially intNN_t, have a natural use in bitfields.
ensure that bitfields defined with these types always have the correct
signedness regardless of compiler & flags used.
see also GCC PR 83294.
Diffstat (limited to 'src/mman/mlock.c')
0 files changed, 0 insertions, 0 deletions