C4100: Converted bit field signed -1 to 1 in comparison

[WARNING]

Description

A signed bitfield entry of size 1 can only have the values 0 and -1. The compiler did find a comparison of such a value with 1. The compiler did use -1 instead to generate the expected code.

Example
  struct A {

  
    int i:1;

  
  } a;

  
  void f(void);

  
  void main(void) {

  
    if (a.i == 1) {

  
      f();

  
    }

  
  }

  
Tips

Correct the source code. Either use an unsigned bitfield entry or compare the value to -1.