[tor-bugs] #29209 [Core Tor/Tor]: Reduce visibility of more data type internals
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Apr 30 20:19:45 UTC 2019
#29209: Reduce visibility of more data type internals
----------------------------------------+----------------------------------
Reporter: nickm | Owner: (none)
Type: task | Status: new
Priority: Medium | Milestone: Tor:
| 0.4.1.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: technical-debt refactoring | Actual Points: 3.5
Parent ID: | Points: 15
Reviewer: nickm | Sponsor: Sponsor31-can
----------------------------------------+----------------------------------
Comment (by catalyst):
Replying to [comment:15 asn]:
> Replying to [comment:14 nickm]:
> > This strategy looks good!
> >
> > Also, let's change the identifier so that it's more clearly not
reserved; I'm not sure that the `## _ ## _private` trick is actually any
more legal than `##__private`. Instead let's use something like `x ##
_MODULE_NAME_private_field` maybe?
> >
> > The `pvt` version is fine with me.
> >
> > If this is going to be a shared macro, lib/cc seems like a decent
place for it, but I'm not sure we want to use this same macro everywhere:
I think we'd like to mangle member names differently depending on which
module owns them.
>
> OK, pushed a fixup to address the above. I kept the macro private, so
that each module makes their own. After we have a few of those, we can see
if we can turn it into a common one.
It looks like the resulting member name no longer begins with an
underscore? That'll make it harder to search for improper uses. I think
Nick's concern is that `## __private` might still impinge on the "reserved
for any purpose" name space? I think `_ ## x ##
_module_name_private_field` is better because it adds a leading
underscore.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29209#comment:18>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list