title: 'dev_addr' undeclared (first use in this function)
body: <p>I'm using NIOS II - Eclipse
  Here is a sample of my code
  I'm basically trying to call a function</p>
  
  <pre><code>struct DevDesc {
  
  u32* mmio;
  
  }
  
  struct DevDesc dev_desc;
  
  struct MemDesc mem_desc_g;//this structure is defined in another file
  
  struct SysDesc sys_desc_g = {
  
  .dd = &amp;dev_desc,
  
  .md = &amp;mem_desc_g,
  
  };
  
  u32 power_mode_sleep (struct SysDesc *sd)
  
  {
  
  void * dev_addr = sd-&gt;dd-&gt;mmio;
  
  //code
  //code
  //code
  
  return 0;
  
  }
  </code></pre>
  
  <p>and a few lines later I try to call it</p>
  
  <pre><code>int main()
  
  {
  
  power_mode_sleep((u32*)dev_addr);
  
  }
  </code></pre>
  
  <p>When i try to build it throws up the error 'dev_addr'  undeclared (first use in this function) and it points to the line</p>
  
  <pre><code>power_mode_sleep((u32*)dev_addr);
  </code></pre>
  
  <p>I tried to make the code brief, only putting what I thought was necessary. If anyone would like to see more details I would be happy to provide them.</p>