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

_RWSTD_NO_NATIVE_IO doesn't disable native I/O

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.2.1
    • 4.2.2
    • 27. Input/Output
    • None
    • non-POSIX

    • Compiler Error

    Description

      Quoting from the thread Re: stdcxx and POSIX

      We are trying to use stdcxx library on a environment where POSIX
      environment is not available (and it is not a win32 platform), as
      a continuation of RoguWave library. We would like to know if
      stdcxx supports it. We have found some occurrences of POSIX
      headers and symbols in file.cpp and iostream.cpp. Although
      run-time behavior for iostreams can be changed by passing
      unofficial extension to openmode _RWSTD_IOS_STDIO, but the POSIX
      symbols are still present, so the compilation will fail. There is
      _RWSTD_NO_NATIVE_IO as the README file says:

      o _RWSTD_NO_NATIVE_IO
      [lib, over]
       #defined  to force  file streams  to use  the facilities  of libc
       stdio as opposed to the POSIX I/O interface.
      

      and here:

        #ifndef _RWSTD_NO_NATIVE_IO
        # define _RWSTD_INVALID_FILE     -1
        # define _RWSTD_INVALID_OPENMODE -1
        #else
        # define _RWSTD_INVALID_FILE      (FILE*)0
        # define _RWSTD_INVALID_OPENMODE  0
        #endif // _RWSTD_NO_NATIVE_IO
      

      but that does not to fix the problem at all.

      On other side, the initialization routine (iostream.cpp) uses POSIX
      file descriptors and posix calls for std console streams (cout,
      cin, cerr objects and wchar equivalents), in this case there is no
      other way than patching library to replace it with stdio.h functionality.

      To reproduce the problem, on the system where POSIX is not present:

      #include <iostream>
      int main() { return 0; }
      

      Will fail, because we could not compile it, even if we compiled it
      excluding files that use POSIX we will get linking errors. Is
      there any chance of solving it in your upstream? We know about the
      status of Apache STL.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: