> On Feb 16, 2020, at 2:58 PM, John Paul Adrian Glaubitz 
> <glaub...@physik.fu-berlin.de> wrote:
> 
> Hi Kim!
> 
> On 2/15/20 10:30 PM, Kim Barrett wrote:
>> I prefer the approach using a non-ODR-used dummy to the approach of
>> casting of some random number to an address.  Non-ODR-used
>> declarations are well supported by the standard (C++03 3.2) and widely
>> used; that's the basis for the "sizeof trick" metaprogramming idiom,
>> for example.
> 
> I've now understood that approach and implemented it. Please see my patch in 
> [1].
> 
> FWIW, I have tried to put the declaration of RegistersForDebugging outside
> the X_offset() functions but that doesn't work. Hope the change is now
> okay as is :).
> 
> Adrian
> 
>> [1] http://cr.openjdk.java.net/~glaubitz/8239001/webrev.02/

Nope.  That unnecessarily pollutes the global namespace with “dummy_regs”.

The dummy declaration should be in the RegistersForDebugging class as I 
suggested earlier.
But you say that “doesn’t work”.  I thought perhaps that meant I’d made was a 
mistake in the
code snippet I’d sent, but that seems to work for me.  So what do you mean by 
“doesn’t work”?

Reply via email to