signed char comparison not working

The below code prints 1, why?
Compiled on ESP32/Arduino sketch, ver 1.8.3

void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);
  char b = -1;
  char c = 1;
  Serial.println(b>c);

}

void loop() {
  // put your main code here, to run repeatedly:

}

char is signed, right?

wonderfuliot:
The below code prints 1, why?
Compiled on ESP32/Arduino sketch, ver 1.8.3

Not here.
Compiled on Nano, ver 1.8.7

void setup() {
  Serial.begin(250000);
  char b = -1;
  char c = 1;
  Serial.println(b > c);
}
void loop() {}
0

There are no guarantees about the signedness and size (other than it being at least 8 bits) of the char type. It may vary from one architecture to another. On the ESP32, char is an unsigned 8 bit type. On the AVR architecture, it's a signed 8 bit type.

I recommend only using char to store characters. If you need a signed 8 bit type, use int8_t.

wonderfuliot:
char is signed, right?

No, "signed char" is signed, "unsigned char" is unsigned, "char" is implementation dependent.

Something to play with...

void setup( void )
{
  unsigned char uc1;
  signed char sc1;
  char c1;

  uc1 = -1;
  sc1 = -1;
  c1 = -1;

  Serial.begin( 250000 );
  Serial.print( F("unsgined char --> ") );
  Serial.println( (int)uc1 );
  Serial.print( F("signed char   --> ") );
  Serial.println( (int)sc1 );
  Serial.print( F("char          --> ") );
  Serial.println( (int)c1 );

  if ( (int)((char)(-1)) == 255 )
  {
    Serial.println( F("char is UNSIGNED on this platform.") );
  }
  else if ( (int)((char)(-1)) == -1 )
  {
    Serial.println( F("char is SIGNED on this platform.") );
  }
  else
  {
    Serial.println( F("char is something crazy on this platform.") );
  }
}

void loop( void )
{
}

Uno...

unsgined char --> 255
signed char   --> -1
char          --> -1
char is SIGNED on this platform.