Enable clang warning for char overflow char ch = 0xe4;

Viewed 64

I noticed that clang gives warning when we write char ch = 228; but it doesn't give any warning when we write: char ch = 0xe4;. Is this behavior intended and is there a way to make clang generate the same warning for the latter? Demo

char ch = 228;    //clang gives warning as expected warning: implicit conversion from 'int' to 'char' changes value from 228 to -28
char ch2 = 0xe4; //clang does not give warning here

I've already read Enable gcc warning for literal char overflow but that is for gcc.

0 Answers
Related