title: Is use of function return values for error checking and/or exception handling good and proper technique?
body: <p>I've inherited a C system which makes use of function return values to check for errors and exceptions; something like this:</p>
  
  <pre><code>#define OK 1
  
  int create_cheese(const char * myType, float myCost, char * myCheese) {
     // Do Stuff...
  
     if // everything looks good
         return 1;
     else
         return // error/exception code
  }
  
  int main() {
      rc = create_cheese("cheddar", 12.99, &amp;cheese);
      if (rc != OK) { exit(rc); }
  
      return 1;
  }
  </code></pre>
  
  <p>Is this considered proper C technique?</p>
  
  <p>These functions are not very, well, functional. In other words, they don't use the function return values as meaningful data relevant to program execution; they're used for error and exception handling. Thank you, Keith :^)</p>