468,512 Members | 1,422 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

statement not reached

Hi All

i am working to fix all warning messages in my c code.
i am getting "statement not reached" warning.How can i resolve it? please give me some tips to resolve this warning.

Thanks in advance.
Mar 24 '08 #1
2 5790
weaknessforcats
9,207 Expert Mod 8TB
You have code that is not logically reachable. LIke this:

Expand|Select|Wrap|Line Numbers
  1. if ( a == 2)
  2. {
  3.     //etc...
  4.     return;
  5. }
  6. else
  7. {
  8.      //etc...
  9.      return;
  10. }
  11. //etc...            //not reachable
  12. return;  
  13.  
You will simplyhave ot look where the compiler says there is unreachable code and see why there is no way to get there.
Mar 24 '08 #2
Thanks for the great help. i'll look in to my code to resolve the problem.
Mar 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by jjliu | last post: by
7 posts views Thread by Graham James Campbell CS2000 | last post: by
5 posts views Thread by muser | last post: by
7 posts views Thread by Sunny | last post: by
13 posts views Thread by axr0284 | last post: by
16 posts views Thread by cmdolcet69 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.