CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

loop problem :(
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Jan 11, 2009 5:27 am     Reply with quote

Yes that's clear, these two examples are also rejected by CCS C, unlike usual C compilers, it doesn't allow recursion at all. This problem can be solved by my goto variant. The application can be compiled and run without stack overflow then.
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Mon Jan 12, 2009 9:20 am     Reply with quote

I have never had to use GOTO in C and yes I do embedded C as well.
I can always find a solution which doesn't require goto's and always results in neater and easier to read code.

Using goto's in C complicates the code, making it harder to track down and fix bugs. Again, I have had to deal with this as I used to work with someone who thought putting a goto here or there to fix a problem was fine. This usually resulted in a tempory bypass which would eventually fail, it was then harder for me to fix!

You are correct, goto's are valid C code and a lot of people don't follow the old theory that they are bad. But then again, I don't think pointers are bad but a lot of people are trying to erradicate there use (C#, java) stating that they are the cause of bad programs. It is not the use of them it is how they are used!

I don't like the use of goto's and if you need to use them then there is usually something wrong with the code and you are trying to patch it! Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group