Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-284

Unit tests fail to compile with xlc_r on AIX

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.11.0
    • Build
    • None

    Description

      On May 12, 2008, at 2:43 AM, Chakravarthula, Krishnamurthy wrote:

      Experts,

      Since I am getting error with gcc compiler, I am trying with default compiler (/usr/vac/bin/xlc_r) on AIX for build. I am able to build APR and APR-UTIL but I get following error during make of log4cxx. Please help.

      source='helpers/datetimedateformattestcase.cpp' object='datetimedateform
      attestcase.o' libtool=no DEPDIR=.deps depmode=aix /bin/sh ../../../depcomp xlC
      _r -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_S
      TRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\" -
      DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAV
      E_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STD
      INT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -I../../../src/main/include
      -I../../../src/main/include -U_STR_ -D_THREAD_SAFE -D_USE_IRS -D_LARGEFILE64_
      SOURCE -I/tmp/apr/include -I/tmp/apr-util/include -I/tmp/apr-util/xml/expat/l
      ib -g -c -o datetimedateformattestcase.o `test -f 'helpers/datetimedateformatte
      stcase.cpp' || echo './'`helpers/datetimedateformattestcase.cpp
      "helpers/datetimedateformattestcase.cpp", line 186.14: 1540-0218 (S) The call do
      es not match any parameter list for "put".
      "/usr/vacpp/include/xloctime.t", line 159.5: 1540-1283 (I) "std::time_put<char,s
      td::ostreambuf_iterator<char,std::char_traits<char> > >::put(ostreambuf_iterator
      <char,std::char_traits<char> >, ios_base &, char, const tm *, const char *, cons
      t char *) const" is not a viable candidate.
      "helpers/datetimedateformattestcase.cpp", line 186.35: 1540-0256 (I) A parameter
      of type "char" cannot be initialized with an expression of type "const tm *".
      "/usr/vacpp/include/xloctime", line 178.13: 1540-1283 (I) "std::time_put<char,st
      d::ostreambuf_iterator<char,std::char_traits<char> > >::put(std::ostreambuf_iter
      ator<char,std::char_traits<char> >, ios_base &, char, const tm *, char, char) co
      nst" is not a viable candidate.
      "helpers/datetimedateformattestcase.cpp", line 186.35: 1540-0256 (I) A parameter
      of type "char" cannot be initialized with an expression of type "const tm *".
      make: 1254-004 The error code from the last command is 1.

      Microsoft Visual C++ 6.0 shipped with an non-standard implementation of std::time_put<T> and std::use_facet. In the log4cxx implementation this is now currently checked by

      #if defined(_MSC_VER) && _MSC_VER < 1300

      However in the unit tests, this was checked by

      #if defined(_USELOC)

      which is macro defined by VC6 to be used instead std::use_facet. It appears that _USELOC is defined in your build which cause the VC6 specific code path to be used instead of the C++ standard code path to be used and the calling parameters don't match since VC6 left out the fill character. Try the following change and see if that addresses the issue.

      Index: src/test/cpp/helpers/datetimedateformattestcase.cpp
      ===================================================================
      — src/test/cpp/helpers/datetimedateformattestcase.cpp (revision 654826)
      +++ src/test/cpp/helpers/datetimedateformattestcase.cpp (working copy)
      @@ -181,7 +181,7 @@
      // output the using STL
      //
      std::basic_ostringstream<logchar> buffer;
      -#if defined(_USEFAC)
      +#if defined(_MSC_VER) && _MSC_VER < 1300
      _USEFAC(locale, std::time_put<logchar>)
      .put(buffer, buffer, &date, fmt.c_str(), fmt.c_str() + fmt.length());
      #else

      Attachments

        Activity

          People

            carnold@apache.org Curt Arnold
            carnold@apache.org Curt Arnold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: