This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use _Generic with bit-fields


On Mon, 22 Feb 2016, Wink Saville wrote:

> What about printing of "long" bit fields? I wonder if there should be an
> option which indicates that bit field types should not include their length.

"long" bit-fields aren't even guaranteed by ISO C to be supported at all; 
portable code must avoid them.  The portable way to print values of 
arbitrary integer types is to cast to intmax_t / uintmax_t and then use 
corresponding formats; that works fine with such bit-fields as well as 
normal types.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]