title: When to use const void*?
body: <p>I have this very simple test function that I'm using to figure out what's going on with const qualifier.</p>
  
  <pre><code>int test(const int* dummy)
  {
     *dummy = 1;
     return 0;
  }
  </code></pre>
  
  <p>This one throws me an error with GCC 4.8.3.
  Yet this one compiles:</p>
  
  <pre><code>int test(const int* dummy)
  {
     *(char*)dummy = 1;
     return 0;
  }
  </code></pre>
  
  <p>So it seems like the const qualifier works only if I use the argument without casting to other type. </p>
  
  <p>Recently I've seen codes that used </p>
  
  <pre><code>test(const void* vpointer, ...)
  </code></pre>
  
  <p>At least for me, when I used void*, I tend to cast it to <strong>char*</strong> for pointer arithmetic in stacks or for tracing. How can <strong>const void*</strong> prevent subroutine functions from modifying the data at which <strong><em>vpointer</em></strong> is pointing?</p>