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

[csmith-dev] CSmith bitfields wreak havoc



Hi,

After Xuejun confirmed that the 0-bitfield issue was fixed I updated my git version, recompiled and now get problems with sizes of bitfields being larger than their type.
/*
 * This is a RANDOMLY GENERATED PROGRAM.
 *
 * Generator: csmith 2.1.0
 * Git version: b911750
 * Options:   --no-checksum --no-math64 --no-longlong --no-argc
 * Seed:      1994221572
 */


#define NO_LONGLONG

#include "csmith.h"

volatile uint32_t csmith_sink_ = 0;

static long __undefined;

/* --- Struct/Union Declarations --- */
struct S0 {
   signed f0 : 16;
   uint32_t  f1;
   signed f2 : 29;
};


....


f2 has bitfield width 29 but f2 size is 16. GCC doesn't compile complaining that:
error: width of 'f2' exceeds its type.


Cheers,

--
PMatos


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