[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling with pgCC



Hi Warren,

> > Actually, I was referring to a different error (an undefined
> > reference), not to the warning about change of sign.  Although it is
> > valid C++ to store a signed quantity in an unsigned variable, the
> > Portland Group compiler is just being "extra helpful" in providing a
> > warning about this, because it may not be what was intended.  The
> > warning may just be ignored in this case.
> 
> I guess it would probably be good to find the cause of the warning and fix 
> it. 
> It is usually bad form to store signed values into unsigned typed variables.

Yes, you're right of course.  In this case no other C++ compiler
produced the warning (even g++ with -Wall -pedantic).

But I think a cast would make the warning go away in all cases.  If we
still have access to a local PG C++ compiler, I'll see if I can verify
that.

--Russ