This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Volatile qualification on pointer and data


On 26/09/2011 02:37, Miles Bader wrote:
David Brown<david.brown@hesbynett.no> writes:
So what advantages would there be in declaring a volatile buffer like
this to be "const"?  At best, you are helping the compiler check that
you don't accidentally write to it in your own code.

That's actually pretty handy tho...



Oh, I'm all in favour of static error checking - use const pointers where possible, and there are not many of gcc's warning flags that I don't use. But I'd weigh code clarity above error checking in this case, especially since it is very unlikely that you'd write code that accidentally wrote to the buffer.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]