[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-dev] 0-width named bitfield


As far as I know 0-width named bitfields are not allowed, but they are being generated by
 * Generator: csmith 2.1.0
 * Git version: 60de822
 * Options:   --no-checksum --no-argc
 * Seed:      662099352

struct S0 {
   signed f0 : _CSMITH_BITFIELD(46);
   unsigned f1 : _CSMITH_BITFIELD(26);
   signed f2 : _CSMITH_BITFIELD(12);
   signed f3 : _CSMITH_BITFIELD(16);
   const signed f4 : _CSMITH_BITFIELD(26);
   volatile signed f5 : _CSMITH_BITFIELD(32);
   volatile unsigned f6 : _CSMITH_BITFIELD(62);

f5 is a zero width bitfield. After preprocessing:
volatile signed f5 : (((32)>(sizeof(int)*16))?((32)%(sizeof(int)*16)):(32));

sizeof(int) for our arch is 1.

Paulo Matos

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog