Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/17/11 20:32
Read: times


 
#180659 - Lots of tools available
Responding to: ???'s previous message
There are much tools available that scans source code statically to find access errors and other problems. Have you looked at Lint?

Note that the generic C pointer is almost impossible to combine with range checking since it's intentionally allowed to support a lot of nice tricks. The next thing is that C can produce code quality quite close to assembler just because it maps so closely to real hardware. Having every pointer not only have an address, but also a step size and a min and max value, would help a lot. But the size of the pointer suddenly became several times larger. And it now requires a lot of registers, or memroy space, to transfer a pointer as a parameter or in a return. And all increments, decrements, general arithmetic, indirection etc must perform checks against these limits, making the code much larger. How fun would it be to test a 64kB program if you need a 128kB processor to be able to run the augmented binary?

Pascal is way easier to perform runtime checks on, since the amount of operations allowed on a pointer is way less.

The flexibility and efficiency is the strong side of C. But it's also the weak side. So if you add your runtime checking, you will have lost much of your flexibility and/or efficiency in which case C woldn't really have any strong points anymore. If the goal is Pascal with C syntax then it's better to just ignore the syntax issue and use Pascal from the start. Or move all the way to Ada. With ironclad descriptive declarations that doesn't allow dangerous constructs, you don't hardly need any runtime testing.

List of 23 messages in thread
TopicAuthorDate
it just struck me, is this why RTOS 'need' is so prevalent?            01/01/70 00:00      
   Two Camps Here            01/01/70 00:00      
   Best Practice            01/01/70 00:00      
   a similar discussion...            01/01/70 00:00      
      I have always maintained the belief...            01/01/70 00:00      
         "non-arbitrary" ?            01/01/70 00:00      
            "Real" Processing exposed            01/01/70 00:00      
               Too Specific            01/01/70 00:00      
               sweeping generalisation            01/01/70 00:00      
                  RTOS are very useful            01/01/70 00:00      
                     I think this got away ...            01/01/70 00:00      
                        Blocking/nonblocking I/O            01/01/70 00:00      
                        Not The only reason            01/01/70 00:00      
                  I considered developer effort            01/01/70 00:00      
                     code generator            01/01/70 00:00      
                        Another neat feature            01/01/70 00:00      
                           there is such an attachment ...            01/01/70 00:00      
                           Lots of tools available            01/01/70 00:00      
                              not really            01/01/70 00:00      
                           Lots of C tools            01/01/70 00:00      
                              widespread            01/01/70 00:00      
                                 Missed the point!            01/01/70 00:00      
                                    Ecosystem            01/01/70 00:00      

Back to Subject List