This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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