title: When to use function-like macros in C
body: <p>I was reading some code written in C this evening, and at the top of
  the file was the function-like macro HASH:</p>
  
  <pre><code>#define HASH(fp) (((unsigned long)fp)%NHASH)
  </code></pre>
  
  <p>This left me wondering, why would somebody choose to implement a
  function this way using a function-like macro instead of implementing
  it as a regular vanilla C function? What are the advantages and
  disadvantages of each implementation?</p>
  
  <p>Thanks a bunch!</p>