lmi
[Top][All Lists]
Advanced

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

[lmi] Fixing 64-bit GNU/Linux gcc-4.x issues


From: Greg Chicares
Subject: [lmi] Fixing 64-bit GNU/Linux gcc-4.x issues
Date: Wed, 14 Nov 2007 03:53:12 +0000
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Vadim--You reported three issues, and I believe I've fixed two of
them already:

(1) 20071114T0313Z ChangeLog: I don't know how we missed changing
this cast as part of the similar change on 20070401T1429Z.

(2) 20071114T0315Z ChangeLog: wxUSE_STL no longer required.

The third issue is this g++-4.2.1 warning
  actuarial_table.cpp:74: warning: negative integer implicitly converted to 
unsigned type
stemming from this line
        T const invalid(-1);
in a function template instantiated with an unsigned type such as
'unsigned char'. I'm working on an msw system with gcc-3.4.4; the
gcc-4.x that I have is unstable, and I'd rather avoid building
everything with it right now, so could I ask you to try something
like the following technique used in 'tn_range.tpp'?

    /// Signum, defined here to return 0 for NaNs.
    ///
    /// To handle unsigned types without warnings, the value zero is
    /// stored in a volatile variable, and the value negative one is
    /// cast to the argument type.

    template<typename T>
    T signum(T t)
    {
    ...
        T volatile zero = 0;
        if(t < zero)
            {
            return static_cast<T>(-1);
            }
    ...

and let me know if that change gives us a clean compile on 64-bit
GNU/Linux? There must be some way to do this, so that C++2003 can
be implemented: its section 21.3/6 defines
  static const size_type npos = -1;
for std::string, whose size_type must be unsigned.

As we were discussing, a clean compile doesn't yet mean that the
64-bit binary actually works: I suspect that the code that reads
'.db4' or '.dat' and '.ndx' files may be the culprit, and that's
probably not worth fixing because it'd be much better to replace
those clunky old binary data files with xml anyway.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]