How to disable "is too small to hold all values of" warnings for enums in bitfields

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?

More questions in this forum
There are no posts to show. This could be because there are no posts in this forum or due to a filter.