Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-526

Use of undefined stricmp breaks compilation on Linux

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • CurrentCVS
    • None
    • XalanC
    • None
    • SuSE-Linux-9.3

    Description

      The use of stricmp is not recommended on systems where this symbol is not defined. There are some tender basic approaches in the xalanc sources to make the case-insensitive comparison abstract (e.g. xml-xalan/c/src/xalanc/Utils/MsgCreator/MsgCreator.cpp: depending on the symbol OS390 be defined, strcasecmp is used instead of stricmp).

      There's a workaround to compile on systems where stricmp is not defined:
      ./runConfigure ... -z -Dstricmp=strcasecmp
      but this seems rather a dirty hack than a solution.

      Clearly, the clean way would be to have the presence of stricmp checked during configure, and have a symbol HAVE_STRICMP indicating the result of the check. However, this would require to have a config.h and source files that make use of it. At the end, making such changes possibly was only waste of time, if xalan switched to autotools one day (like xerces already has done).

      So, I provide a patch, that works for me, but possibly breaks other setups. I don't intend to fix anything here but to use strcasecmp instead of stricmp on linux systems. My real intention here is to give a hint (in form of a diff file), which parts of xalan are affected by this issue, so it might help in implementing a clean solution, in the case that autotools will actually be used for xalan.

      Attachments

        1. patch.txt
          16 kB
          Dmitry Hayes
        2. process.cpp.txt
          12 kB
          David N Bertoni
        3. stricmp-20050612.diff
          3 kB
          Axel Weiss

        Activity

          People

            dmitryh Dmitry Hayes
            aweiss Axel Weiss
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: