← Back to team overview

cuneiform team mailing list archive

Question for Cognitive developers

 

Hi

I have been working on minimizing the amount of compiler warnings. I
get lots of warnings about exceeding values for type. For example in
rstr/src/embbox.c we have this:

static void store_many(uint16_t ibcos, char let, char ff, int16_t typl)
{
     if(language==LANG_RUSSIAN) return;
  switch (let)
   {
    case 'x': case 'c': case 'v':
    case 's': case 'w':

[lots of case statements removed here]

   case c_bottom_accent :

We switch on variable let, which is a signed char, and thus has a
maximum value of 127. c_bottom_accent is defined as

#define c_bottom_accent     0xE7

which is 231. This case statement can never be reached.

What would be the correct way to fix this? Does MSVC do something
special in this case or is there some deeper bit magic going on?