title: Initializing an atomic flag in a malloc'd structure
body: <p>I'm trying to use atomics in <code>C</code> on FreeBSD 10.1 Release with clang 3.6.1, however when I try to compile a program using <code>ATOMIC_FLAG_INIT</code> on a <code>atomic_flag</code> variable in a <code>struct</code> I get <code>error: expected expression</code>.</p>
  
  <p>Here is the program I am trying to compile.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdatomic.h&gt;
  
  struct map
  {
  
      atomic_flag flag;
  
  };
  
  int main(void)
  {
      struct map *m = malloc(sizeof(struct map));
  
      m-&gt;flag = ATOMIC_FLAG_INIT;
  
      free(m);
  
      return 0;
  }
  </code></pre>
  
  <p>I can use <code>atomic_flag</code> outside of <code>structs</code> like in the example below but not in <code>structs</code>, so how do you use atomic variables in <code>C</code> <code>structs</code>?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdatomic.h&gt;
  
  int main(void)
  {
      atomic_flag flag = ATOMIC_FLAG_INIT;
  
      return 0;
  }
  </code></pre>