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

Use of undefined stricmp breaks compilation on Linux

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: CurrentCVS
    • Fix Version/s: None
    • Component/s: XalanC
    • Labels:
      None
    • Environment:
      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. process.cpp.txt
          12 kB
          David N Bertoni
        2. patch.txt
          16 kB
          Dmitry Hayes
        3. stricmp-20050612.diff
          3 kB
          Axel Weiss

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: