title: How to log values from enums with the prepocessor to a file
body: <p>I declare a enum like that:</p>
  
  <pre><code>typedef enum message_t {
      mes_no_error    =   0,  // no message sent
      mes_internal    =   1,  // reserved for internals
      mes_start       =   2,  // when main() is executed
      mes_init        =   3,  // when inits in main() are done
      mes_end         =   4,  // when main() returns
      mes_foo,
      mes_bar,
      mes_joe
  } message;
  </code></pre>
  
  <p>As this is for a microcontroller which talk to me on the PC, I would like to know the values that are used for mes_foo, mes_bar, mes_joe....</p>
  
  <p>I thought I could use compiler directives like that:</p>
  
  <pre><code>#warning "mes_block_01 = " mes_joe
  </code></pre>
  
  <p>and later tee, regex and dump the values to a file when compiling the program. However, gcc just tells me:</p>
  
  <pre><code>message.h:63:2: Warnung: #warning "mes_block_01 = " mes_joe
  </code></pre>
  
  <p>with no value, but only the enum name.</p>
  
  <p>Is it somehow possible to log automatically assigned values from enums to a file? Is it somehow possible to show values of constants/defines with the preprocessor or during compile time?</p>