On Mon, Jul 29, 2013 at 02:10:40PM -0700, Ethan Jackson wrote:
> > In lockfile.c, I guess that clang can only handle guarded-by on
> > pointers?  Otherwise I don't see why one would introduce the new
> > lock_table variable as a level of indirection.  Assuming that's true,
> > can we declare lock_table as a const pointer, e.g.
> >     static struct hmap *const lock_table OVS_GUARDED_BY(lock_table_mutex)
> >         = &lock_table__;
> > (That is, the pointer is const, not what it points to.)
> 
> Yes, this is fairly annoying.  Clang doesn't consider taking the
> address of a variable as a read.  Technically they're right, but that
> opens the door to all kinds of unsafety.  In my experience, this
> change catches bugs, so I think it's worth the ugliness.

Yeah, I understand the rationale, I just want to know whether we can
make the pointer const.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to