C ????: unsigned long and unsigned long long bit-fields

Submitter:Philipp Klaus Krause
Submission Date:????-??-??

Summary:

unsigned long and unsigned long long bit-fields.

This adds unsigned long and unsigned long long to the supported types for bit-fields.

Justification:

C currently mandates upport for bool, int, signed int and unsigned int as types for bit-fields. Support for further types is implementation-defined. However, larger bit-fields are useful and having them supported in the standard would be good. Most useful would be types larger than int (since these add functionality that is currently not mandated by the standard).

Such types are supported by many implementations, including IAR, GCC and clang. They are widely used.

Debian code search shows that in particular, unsigned long and unsigned long long are very widely used, in different programs (including e.g. GCC and Linux)

Do we want to support bit-fields of type unsigned long and unsigned long long?

Proposed change (vs N2596): In 6.7.2.1p5, change "A bit-field shall have a type that is a qualified or unqualified version of _Bool , signed int, unsigned int, or some other implementation-defined type." to "A bit-field shall have a type that is a qualified or unqualified version of _Bool , signed int, unsigned int, unsigned long, unsigned long long or some other implementation-defined type.", and in J.3.9, change "Allowable bit-field types other than _Bool, signed int, and unsigned int" to "Allowable bit-field types other than _Bool, signed int, unsigned int, unsigned long, unsigned long long" and in J.5.8 change "A bit-field may be declared with a type other than _Bool, unsigned int, or signed int" to "A bit-field may be declared with a type other than _Bool, unsigned int, signed int, unsigned long or unsigned long long".