r20242?

Alexander Bokovoy ab at samba.org
Wed Dec 20 07:45:45 GMT 2006


tridge at samba.org wrote:
> that 'spirit' doesn't matter.
> 
> the const keyword means "don't allow me to change the bytes
> accessible through this pointer, and assume for optimisations that
> they won't change". (not the exact words in the standard, but good
> enough).
Standard says:
"6.7.3.5. If an attempt is made to modify an object defined with a
const-qualified type through use of an lvalue with non-const-qualified
type, the behavior is undefined." (as in committee draft, 2005/05/06)
Technically, there is only 'restrict' qualifier which is intended to
promote optimizations.

Not that it matters in this case, ;-) I agree that 'spirit' is not what
compiler should respect.

> If you want some other keyword that does what you want then invent
> one and make a tool like sparse use it. Don't try to imbue a C
> keyword with meanings it doesn't have.
You right, it is an abuse of a C keyword.

-- 
/ Alexander Bokovoy
Samba Team                      http://www.samba.org/
ALT Linux Team                  http://www.altlinux.org/
Midgard Project Ry              http://www.midgard-project.org/


More information about the samba-technical mailing list