title: Expand a macro in a macro
body: <p>Given the following macros giving access to compiler attributes in a function-call way, like <code>spec(section(".mysection")) void foo(void);</code>:</p>
  
  <pre><code>#define spec(_H_) spec_##_H_
  #define spec_section(_S_) attribute ((section (_S_)))
  </code></pre>
  
  <p>I now would like to use these definitions in other macros, like <code>spec(namespace(unmanaged)) int x;</code>:</p>
  
  <pre><code>#define spec_namespace(_H_) spec_namespace_##_H_
  #define spec_namespace_unmanaged spec(section(".unmanaged"))
  </code></pre>
  
  <p>But this does not expand at all, the only way to make it work is writting the expanded spec() macro myself:</p>
  
  <pre><code>#define spec_namespace_unmanaged spec_section(".unmanaged")
  </code></pre>
  
  <p>Any idea of what is going on? gcc -E on <code>spec(namespace(unmanaged))</code> results in<code>spec(namespace(unmanaged))</code>.</p>