<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">

  <title>RCST7 - C111</title>
  <link rel="stylesheet" type="text/css" href="errors.css">
</head>

<body>
  <h1><a name="RCST7-C111" id="RCST7-C111"></a>RCST7 WARNING C111</h1>
  <!-- Note that the header should be non scrollable, so that it always
     remains on top even if the user scrolls down a loooong text. -->
  <!-- This is the Error title -->

  <h2>Operation with void type</h2>

  <p>An operation is done on a void type</p>

  <h2>Example</h2>
  <pre>
int foo(void *a)
{
   if(a++)
      return 1;
   return 0;
}
</pre>

  <h2>Resolution</h2>

  <p>The value of a void expression shall not be used in any way. The void
  type can be used only as a pointer and its referenced object cannot be
  accessed if it has not been previously cast in another type.</p>

  <p>A correct implementation of function foo() could be:</p>
  <pre>
int foo(void *a)
{
   int *b = (int *)a;
   if( b++ )
      return 1;
   return 0;
}
</pre><!--Footer Start-->

  <div class="footer">
    <hr>
    <!--Copyright-->

    <p>&copy; Raisonance S.A.S. 1987-2007. All rights reserved.</p>
  </div><!--Closes the footer div-->
  <!--FOOTER_END-->
</body>
</html>
