On Wed, 2005-05-25 at 03:03 +0200, Gabriel Dos Reis wrote:
> Zack Weinberg <[EMAIL PROTECTED]> writes:
> 
> | On Tue, 2005-05-24 at 10:49 +0200, Gabriel Dos Reis wrote:
> | > | So you don't see any value whatsoever to having (for instance) the
> | > | individual constants of 'enum machine_mode' be inaccessible in most of
> | > | GCC?  'cos I sure do.
> | >
> | > What I'm saying is that when you have a name like EXPAND_NORMAL, you
> | > do not need to know the value it represents.  Just that it names a
> | > constant.
> | 
> | We appear to be still talking about two different cases.  I am talking
> | about the case where, in C++, you might declare something like
> | 
> | class machine_mode
> | {
> |   enum {
> |     VOIDmode, SImode, // ...
> |   } value;
> | 
> |  // accessors, whatever ...
> | };
> | 
> | and then pass around 'machine_mode' objects.  Does this help?
> 
> Nothing in what I said or is proposing prevents that scenario, if you
> decided to go there (despite pessimizations on x86 targets). 

This is still not an answer to the question I originally asked - do you
see any way IN C to write code which has the relevant property of the
class above (that is, that the FOOmode constants are not accessible
except to authorized code) and which does not rely on free conversion
between enumeration constants and integral types?

zw



Reply via email to