title: conversion to ‘unsigned char’ from ‘int’ may alter its value
body: <p>How would you remove the warning produced by <code>gcc -Wconversion</code> on the following code, without an explicit (=ugly) cast:</p>
  
  <pre><code>int main()
  {
    int val;
    unsigned char c1 = (val % 65536) / 256;
    unsigned char c2 = (val % 65536) % 256;
  }
  </code></pre>
  
  <p>Is there a way to tell the compiler that obviously the cast is implicitely done during <code>(% 65536) / 256</code> or <code>% 256</code></p>
  
  <p>For reference</p>
  
  <pre><code>$ gcc -Wconversion w.c
  w.c: In function ‘main’:
  w.c:4:36: warning: conversion to ‘unsigned char’ from ‘int’ may alter its value [-Wconversion]
  w.c:5:36: warning: conversion to ‘unsigned char’ from ‘int’ may alter its value [-Wconversion]
  </code></pre>