 |
 |
| View previous topic :: View next topic |
| Author |
Message |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Jan 11, 2009 5:27 am |
|
|
| 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
|
|
Posted: Mon Jan 12, 2009 9:20 am |
|
|
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!  |
|
 |
|
|
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
|