??? 02/23/08 19:47 Read: times |
#151348 - Fair enough Responding to: ???'s previous message |
Michael Karas said:
I believe that the original idea was that "const" would be used to enforce access rules within the source file. It would make the compiler throw an error if code was encountered that tried to modify something declared with the const attribute. This had/has a lot more utility in OS environments where executables are loaded into a RAM environment such as the original platforms where C was developed and deployed. So it does seem to me it's just a way to make the compiler make sure the developer doesn't do something stupid. Having said that, on the 8052, I don't see much of a problem with "const" putting the constant information into code memory--unless it is specifically overrided by some other modifier that wants to put it elsewhere. Internal RAM is at a premium and storing constants there ought to be the rare exception, not the rule. Regards, Craig Steiner |