On Fri, 22 Aug 2014, DJ Delorie wrote:

> > > > Maybe you need to refactor __glibcxx_digits so there is a version 
> > > > taking 
> > > > the bitsize as an argument rather than using sizeof(T) * __CHAR_BIT__, 
> > > > but 
> > > > that should be the only change needed to handle such types with the 
> > > > existing macros.  The bitsize macros should be the only ones needing 
> > > > predefining to pass information to libstdc++.
> > > 
> > > Like this?
> > 
> > Yes (well, the libstdc++ changes will need to go to the libstdc++ mailing 
> > list for review there, but this is the sort of thing I'd expect to keep 
> > the way libstdc++ defines these limits as consistent as possible between 
> > different types).
> 
> Ok, here's the updated c-cppbuiltins.c and all the libstdc++-v3
> changes, cross-posted to the libstdc++ list.  I tested the macros on
> x86-64 (before and after) and msp430 (after) with __int128 and __int20
> and get the right values in all cases.

I'd like to see the updated version of the whole of patch 3 (tested to be 
actually independent of the other patches) for review, though I won't be 
reviewing the C++ parts.

> +     if (!flag_iso || int_n_data[i].bitsize == POINTER_SIZE)

I don't see flag_iso as relevant here (since the macros are in the 
implementation namespace).  The definitions could reasonably be restricted 
to c_dialect_cxx (), though, given that they are specifically for use by 
libstdc++ (and it's easier to add a macro later for C if needed, than to 
remove one after adding it).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to