title: Why does GCC give me a syntax error when trying to return a struct pointer?
body: <p>I'm using CodeLite on Ubuntu and for some bizzare reason GCC keeps throwing this error whenever I try to compile code with a function that returns a pointer to a struct:</p>
  
  <pre><code>error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  </code></pre>
  
  <p>Here is an example I wrote up to demonstrate this error:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef struct test_t {
      unsigned char someVar;
  };
  
  test_t* testFunc() { // GCC throws that error on this line
      return NULL;
  }
  
  int main(int argc, char **argv)
  {
      return 0;
  }
  </code></pre>
  
  <p>So unless I'm forgetting something obvious I would normally expect this code to compile on any other compiler, namely MSVC, so I'm completely confused as to why it doesn't work.</p>
  
  <p>Hopefully one of you experts can please enlighten me.</p>
  
  <p>Thanks!</p>