Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-937

[Sun C++] unsats on std::numeric_limits<double> data members

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.2.2
    • Component/s: 18. Language Support
    • Labels:
      None
    • Environment:

      CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25

    • Severity:
      Linker Error

      Description

      As reported here, when using Sun C++ on Solaris, ...

      Passing std::numeric_limits<> as an lvalue as in the example below results in undefined symbols for the symbol std::numeric_limits<> at link time:

      #include <iostream>
      #include <algorithm>
      #include <limits>
      
      int main() {
        int i = std::numeric_limits<double>::digits10;
        int j = std::min(std::numeric_limits<double>::digits10, 10);
        //Undefined Symbols
        int j1 = std::max(std::numeric_limits<float>::min_exponent10, 2);
        //Undefined Symbols
        std::cout << i << std::endl;
        std::cout << j << std::endl;
      }
      
      Undefined first referenced symbol in file std::numeric_limits<double>::digits10 t.o [Hint: static member std::numeric_limits<double>::digits10 must be defined in the program]
      
      ld: fatal: Symbol referencing errors. No output written to t *** Error code 1 make: Fatal error: Command failed for target `t' 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebor Martin Sebor
                Reporter:
                sebor Martin Sebor
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h