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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/09/07 03:14
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#130469 - Embedded Specific
Responding to: ???'s previous message
ANSI C does not recognize the fact the Interupts can change variables mid stream. "Volitile" is covers this ( and Hardware registers). Atomic is Very Hardware specific.
Unused variables covers all uses.
You have a list of ways to tell the compiler when not to use auto-atomic. That will scare away compiler makers that have to support it. In the end it will do the same thing you would.

Automatic is not always good try fighting VB or MFC to make it do what you want, not what Microsoft thought was better.

In the end I am sure it can be done. will it save time and make better code, who knows. It could just as easily go the other way and be a worse headache.

With sufficient thrust, pigs fly just fine.
However, this is not necessarily a good idea.
It is hard to be sure where they are going to land,
and it could be dangerous sitting under them as they fly overhead.

From RFC1925, R Callon, 1996.



List of 32 messages in thread
TopicAuthorDate
atomicity, multibyte variables, C and my comfort            01/01/70 00:00      
   No way            01/01/70 00:00      
      Well, theoretically ...            01/01/70 00:00      
   Yes sdcc at least            01/01/70 00:00      
      Keil            01/01/70 00:00      
   Does it matter?            01/01/70 00:00      
      sort of...            01/01/70 00:00      
         Lack of this feature ...            01/01/70 00:00      
            really?            01/01/70 00:00      
   talking out of both sides of the mouth            01/01/70 00:00      
      :-)            01/01/70 00:00      
         the simple solution            01/01/70 00:00      
            The question was not how to fix it...            01/01/70 00:00      
   Don't disable            01/01/70 00:00      
      C extensions            01/01/70 00:00      
         ring buffer, atomicity and C            01/01/70 00:00      
            OK that was a stupid example...            01/01/70 00:00      
      Hardware solution called for            01/01/70 00:00      
         isn't HLL supposed to hide the low level details?            01/01/70 00:00      
            the skinny            01/01/70 00:00      
               Word length & Atomicity            01/01/70 00:00      
            Side effects            01/01/70 00:00      
               questions and answers            01/01/70 00:00      
                  Embedded Specific            01/01/70 00:00      
                     Neil, you GOT it            01/01/70 00:00      
                        waitaminute...            01/01/70 00:00      
                           from an old hand to a newbie            01/01/70 00:00      
                              what helps is good (?)            01/01/70 00:00      
                                 The warning you propose would be 'wrong' in some c            01/01/70 00:00      
                                    wrong warnings            01/01/70 00:00      
                                       Read-Modify-Write            01/01/70 00:00      
                                          OK then not simple            01/01/70 00:00      

Back to Subject List