We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I use bitfields with enum classes to strongly type as much as I can. Like:
enum class ShutdownMode : uint8_t { NormalOperation = 0b00, ShutdownMode = 0b01, BurstMode = 0b10, // 11 = Unimplemented: this setting has no effect }; // ... struct { ShutdownMode shutdownMode : 2; }; // ...
However I get errors all the time like:
src/Peripherals/MCP96.hpp:167:35: warning: 'MCP96::<anonymous union>::<anonymous struct>::shutdownMode' is too small to hold all values of 'enum class MCP96::ShutdownMode' ShutdownMode shutdownMode : 2;
How can I disable or suppress this warning and still use enum classes as struct members with a small bitfield size?