[pooma-dev] RFA: src/NewField Changes

Jeffrey Oldham oldham at codesourcery.com
Thu Mar 29 18:26:09 UTC 2001


On Thu, Mar 29, 2001 at 10:44:10AM -0700, Scott Haney wrote:
>  On Thursday, March 29, 2001, at 10:35 AM, Jeffrey Oldham wrote: 
> > 
> > > I don't fully understand why the  typedef is required. But, if it 
> > > is  
> > > required by the standard, could we put it in the function? 
> > > 
> >  
> > The C++ standard \S 23.1 [Container requirements] requires 
> > x::size_type to be an unsigned integral type.  I moved the typedef 
> > into the destructor. 
> > 
>  
> Hi Jeffrey, 
> 
> I realize this. What I didn't understand is what the problems were when 
> i in that loop was an int. Did GCC emit a warning or an error. Anyway, 
> this isn't that big of a deal. Please feel free to commit. 

g++ -Wall emits warnings about comparisons between unsigned and signed values:

/nfs/oz/home/oldham/pooma/r2/src/NewField/Updater/UpdaterList.h: In destructor 
   `UpdaterListData::~UpdaterListData()':
/nfs/oz/home/oldham/pooma/r2/src/NewField/Updater/UpdaterList.h:92: warning: comparison
   between signed and unsigned integer expressions

The typedef avoided this warning.

> What was the resolution on all of those static_casts?  

The warnings about comparisons between unsigned and signed ints were
the reason for those static_cast's.  I do not know the best solution.
What do you suggest?

/nfs/oz/home/oldham/pooma/r2/src/Domain/DomainTraits.Interval.h: In static 
   member function `static void DomainTraits<Interval<1> >::setDomain(int 
   (&)[2], const T1&, const T2&) [with T1 = int, T2 = unsigned int]':
/nfs/oz/home/oldham/pooma/r2/src/Domain/Interval.h:365:   instantiated from here
/nfs/oz/home/oldham/pooma/r2/src/Domain/DomainTraits.Interval.h:266: warning: comparison
   between signed and unsigned integer expressions

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com



More information about the pooma-dev mailing list