title: Preprocessor "macro function" vs. function pointer - best practice?
body: <p>I recently started a small personal project (RGB value to BGR value conversion program) in C, and I realised that a function that converts from RGB to BGR can not only perform the conversion but also the inversion.  Obviously that means I don't really need two functions <code>rgb2bgr</code> and <code>bgr2rgb</code>.  However, does it matter whether I use a function pointer instead of a macro?  For example:</p>
  
  <pre><code>int rgb2bgr (const int rgb);
  
  /*
   * Should I do this because it allows the compiler to issue
   * appropriate error messages using the proper function name,
   * not to mention possible debugging benefits?
   */
  int (*bgr2rgb) (const int bgr) = rgb2bgr;
  
  /*
   * Or should I do this since it is merely a convenience
   * and they're really the same function anyway?
   */
  #define bgr2rgb(bgr) (rgb2bgr (bgr))
  </code></pre>
  
  <p>I'm not necessarily looking for a change in execution efficiency as it's more of a subjective question out of curiosity.  I am well aware of the fact that type safety is neither lost nor gained using either method.  Would the function pointer merely be a convenience or are there more practical benefits to be gained of which I am unaware?</p>