title: Print numeric value of a define that's based on other macros via pragma message?
body: <p>This is similar to <a href="https://stackoverflow.com/q/1562074/608639">How do I show the value of a #define at compile-time?</a>. Chris Barry's answer is not working for me:</p>
  
  <pre><code>#ifdef __GNUC__
      #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
  #endif
  ...
  
  #define XSTR(x) STR(x)
  #define STR(x) #x
  #pragma message "The value of GCC_VERSION: " XSTR(GCC_VERSION)
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>$ rm -f dlltest.o &amp;&amp; make dlltest.o
  g++ -DNDEBUG -g2 -O2 -march=native -pipe -c dlltest.cpp
  dlltest.cpp:13:80: note: #pragma message: The value of GCC_VERSION: (4 * 10000 + 9 * 100 + 3)
   #pragma message "The value of GCC_VERSION: " XSTR(GCC_VERSION)
                                                                                  ^
  dlltest.cpp:12:17: note: in definition of macro ‘STR’
   #define STR(x) #x
                   ^
  dlltest.cpp:13:55: note: in expansion of macro ‘XSTR’
   #pragma message "The value of GCC_VERSION: " XSTR(GCC_VERSION)
  </code></pre>
  
  <p>As can bee seen above, the numeric value was not printed. In addition, a lot of extra useless fodder was printed.</p>
  
  <p>How can I have GCC print the numeric value of a define that's based on other macros?</p>