title: What does impossibility to return arrays actually mean in C?
body: <p>I'm not trying to replicate the usual question about C not being able to return arrays but to dig a bit more deeply into it.</p>
  
  <p>We cannot do this:</p>
  
  <pre><code>char f(void)[8] {
      char ret;
      // ...fill...
      return ret;
  }
  
  int main(int argc, char ** argv) {
      char obj_a[10];
      obj_a = f();
  }
  </code></pre>
  
  <p>But we can do:</p>
  
  <pre><code>struct s { char arr[10]; };
  
  struct s f(void) {
      struct s ret;
      // ...fill...
      return ret;
  }
  
  int main(int argc, char ** argv) {
      struct s obj_a;
      obj_a = f();
  }
  </code></pre>
  
  <p>So, I was skimming the ASM code generated by gcc -S and seems to be working with the stack, addressing <code>-x(%rbp)</code> as with any other C function return. </p>
  
  <p>What is it with returning arrays directly? I mean, not in terms of optimization or computational complexity but in terms of the actual capability of doing so without the struct layer.</p>
  
  <p>Extra data: I am using Linux and gcc on a x64 Intel.</p>