tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: "strict" weak aliases

> Sometimes it is important that the type of an object matches the
> type of its weak alias.  See the attached patch that both adds a
> type-safe __weak_alias() called __strict_weak_alias(), and fixes a buggy
> __weak_alias() that __strict_weak_alias() would have caught during
> compilation.
> Thanks to Taylor R. Campbell for the incantation that was key
> to making this work,
> __unused static typeof(alias) *__weak_alias_##alias = &sym;
> Does this look ok to commit?

could you bring this up on tech-toolchain?  i think it would be useful
for userland as well.

one thing -- please change it to use __typeof__.  (we should change
to using this everywhere we use typeof today.  not your problem :)



Home | Main Index | Thread Index | Old Index